Showing posts with label IPhone Application Development. Show all posts
Showing posts with label IPhone Application Development. Show all posts

Rumor: Final Implementation of multimedia messages?

Author: jack // Category:
According to recent rumors of the network, could soon leave an application in the AppStore allowing the function of sending multimedia messages directly through the iPhone. The applicator would be Telia, a Swedish developer. 

The weak point is that no one knows how well would be carried out in agreements between the mobile phone a call (in our case Movistar) and the application, or if you really should be just the phone company responsible for making itself an application for users could send multimedia messages. 
Until now, only had few options available to send or receive multimedia messages across multiple applications. This new App simplify the whole process.

Developing on iPhone (5): our first application (III)

Author: jack // Category:
In our previous article we had included in the interface of our application a Label, a TextField and a Button. Our aim was that the contents of the updated label was introduced with the TextField by clicking on the Button. We had (step 1) created the project, and (step 2) InterfaceBuilder used to define the screen. Continue with the remaining steps to leave the application running. 
Step 3. Create variables in the ViewController. 
We have our interface properly. In fact, if you did Build & Go might be leaving us see how:



But obviously nothing happens in the press the button, because we have not done the minimum necessary developments. In this step 3 we will introduce variables and methods in the HelloWorldViewController, both in the interface (file. H) and implementation (file. M). To do this, as we indicated at the end of the previous post, we need to know that the TextField corresponds to a class UITextField, and the Label with a class UILabel. These 2 classes are within the framework UIKit. 
If we have not closed and recorded Interface Builder, and what do we open the file in XCode HelloWorldViewController.h. The code now have something like this:



We're already seeing some Objective-C. In this code we see an import declaration of the library UIKit, where classes UILabel and UITextField. We see how the interface is declared, and it extends from the generic UIViewController of UIKit. 
Under the code of the interface include the following code:

We can now explain what we did: 
We have declared within the block @ interface 2atributos type UILabel and UITextField, with 2 variable names and label * * textField respectively. IBOutlet appears ahead. What is this? We are told. IBOutlet is not a type of variable is a directive that Interface Builder helps you to know the existence of these variables UILabel and UITextField. Incidentally, remember that in the previous article you had taken a trick to know the types of variable objects of control (buttons, label, text field, etc.). In Interface Builder. On the other hand, the issue of * before the name of variable may be surprised to Java programmers, not so much to learn from C ... but it escribiréis Objective-C in the instance variables. 
UILabel declare their properties and UITextField. nonatomic and retain what we will not for now, is related to memory management. 
We see that we declare a method, UpdateText. He has a sign - in front, indicating that it is an instance method, and no class (for them is a sign). We can not come to explain to this because this is basic object-oriented programming ... This method does not return anything (ie, void) and receives a parameter of type id. It basically refers to the identifier of the object that will lead the call to our UpdateText method, which updates the value of the label. We can already guess that this will be the control button itself ... 
Once done, we have finished with Step 3. 

Step 4. Link controls the view with variables of the controller. 
If we go on the one hand we have developed our interface with Interface Builder, and on the other we have those variables related to these controls in the HelloWorldViewController.h (interface of the class HelloWorldViewController.m controller). But still there is no connection between the light and the driver, that is, we have not given any instruction to relate, for example, the text field we built in Interface Builder with variable rate UITextField we've gotten into the class . Now we are going to perform this task. We opened again Interface Builder by clicking on HelloWorldViewController.xib, click on the box, and the Inspector palette, we are going to the second tab (Text Field Connections). We see that there is a section called Referencing Outlets, with no marked nothing. That means that at the moment Interface Builder is not aware of any connection between this text field and a IBOutlet (Interface Builder Outlet) of a class ... but we have a IBOutlet UITextField in our HelloWorldViewController, so let's link.

To do this, as we see in the picture, clicking on the little circle next to "Referencing New Outlet", drag the File's Owner of the dialog window HelloWorldViewController.xib. We will no longer choose 2 options, view (the full view) and textField (our variable). Obviously we choose textField, and relate well with our pick from the variable of its kind UITextField. Indeed, the File'sOwner or owner of the file is none other than our class controller ... 
We repeat the operation with the label, linking it with our variable controller's label. And with the button, is something different. In this case we are going to connect with our operation UpdateText, but for a specific event. Do this with the event 'Touch Up Inside', and choose our method UpdateText:


And in this way because we do have linked the controls that we had identified with Interface Builder and the variables that we have gotten into the driver. We close Interface Builder recording everything and we are going to step back to XCode. 
Step 5. Recent developments. 
As we open the XCode HelloWorldViewController.my put the following code to us that our class is as follows:


If you look good, we just got the block @ synthesizer, and the implementation of the method declared in the interface. H, UpdateText. Under this code will have much commented code. 
@ Synthesizer line does something similar to generate the typical getter / setter (accesores / mutadores) typical in the language OO (encapsulation). The need for the driver you get the content, for example, the text box. 
The method UpdateText, as you see, simply updating the text of our label with the contents of the text field. We've finished. 
Now, we simply Build & Go, and you will see that by putting a string of text and click on the button, the contents of the label is updated. In the following article will introduce enhancements to our application.


Developing on iPhone (4): our first application (II)

Author: jack // Category:
In our previous post explained how it was going to be our HelloWorld application and the steps we would take to build our application, in addition to providing links to documentation required. In this article we started opening the XCode and began to develop. 
Step 1. Create the Project. 
That is why we opened and closed XCode (if you leave), the welcome screen of the application. Before creating our project, we can go into the preferences of XCode. In General -> Layout choose 'All-In-One', at least if you will be able to compare what you see on your screens with images you will see. 
At this time we created the project: File -> New Project, and choose View-Based:

As we indicated in the previous article, for a project View-Based XCode we created a hearing linked to a class Controller (remember that we spoke of the MVC pattern). Calls to the project and guardadlo HelloWorld in the folder you want. You will see something like this:

We see that we have several files: 
HelloWorldViewController.hy HelloWorldViewController.m. Both correspond to the driver of our screen. Here is the logic related to our view, in our case, this should be the code that makes the value of the label change with the introduction in the box. We see a file. H and another. M. The first is the header, in Java would be the interface. Here are the declarations of variables, methods, etc. The file. M is the one that already contains the deployment. 
HelloWorldViewController.xib. ib = Interface Builder. This file is our view, the screen. MainWindow.xib is invoked by the main front of a view that does not touch. 
HelloWorldAppDelegate (. H and. M). Not going to change, you have a pointer to our ViewController. 
Info.plist. It is an XML with information about our application. Here we can show by example what is the icon of our application. 
Step 2. To design the interface. 
Let's start to "draw" the screen of our application. To do so, in XCode we double-click on the HelloWorldViewController.xib, and we will see that opens the application Interface Builder. First, just as practical advice I strongly recommend that you have always verifiquéis open pallets and Inspector Library. You can open the Tools menu in Interface Builder. The Library palette allows you to add different controls to your eye, and the Inspector palette lets you view the properties of each object and modify them. 
We are not going to try to make an application pretty, but it works. Begin by locating the screen, labeled View. If you're not open, you open it by double-clicking on View in the next screen:


On the hearing, brought forward from the Library palette up a TextField, a label underneath and finally a Round Rect Button. We look, if we have selected a control such as TextField, we can move the size of this control, relocate on screen ... and the Inspector palette, we can dispose of their properties. Selecting the button we can put a value Title "Change!". In the end we will be something like this:


With this we have defined the interface of our application. Complies with what we had expected: a text box (hereinafter TextField) where they get information. A Label (fixed text) and a button. When we push the button, the Label show what they've written in the TextField. To do this we must create the variables that referenced the Label and TextField in our ViewController and we will tell Interface Builder relationship between the Label and TextField with these variables. There will also be to create a method in the ViewController to be responsible for updating the value of the label with which we have entered into the TextField, and relate the button with this method in Interface Builder. All this will be steps 3, 4 and 5 of our original script, and will be explained in the next post. 
However, before the end I strongly recommend that you fijéis in what emerges in the Library palette when you have selected such a TextField to add it to the hearing:



Please note that explains that the TextField control, but also put under "UITextField." This is important because we are signaling what kind of framework UIKit Cocoa corresponds to this control. This gives us a clue: in order to create a variable that handles this control in the ViewController, you'll have to be kind of UITextField.

Developing on iPhone (3): our first application (I)

Author: jack // Category:
In our previous article we had installed the iPhone SDK and had downloaded, compiled and tested a basic example released by Apple. We must now begin to develop, step by step from scratch, a similar application. 
We realize that this is beginning to be the hard part, so let's make a short introduction. As we have said, it is almost essential to have some knowledge of programming in order to understand thoroughly how to develop an application for iPhone. It should be borne in mind that is playing an important number of different materials: 
Design patterns: Business Delegate, MVC (Model View Controller) ... are present in the app easier. 
Programming language Objective-C 
Cocoa 
Frameworks specific development: UIKit, Foundation 
Tools: XCode, Interface Builder, iPhone Simulator ... 
The problem is that if we start by explaining in depth each of these subjects before beginning to develop, the discouragement would logically important. For this series of articles have considered more practical to start directly with development on the SDK, and be giving strokes of each of these issues on the fly. However, before we begin to develop, we leave you some links to documentation of interest: 
iPhone Reference Library (here you can find articles, books ...), and specific guidelines. 
The Objective-C Programming Language 2.0. The reference base of the programming language used to program our applications. It is almost essential to go known ... I have also found a book in Castilian programming for C and Java programmers. 
Cocoa Fundamentals Guide: A comprehensive guide to Cocoa, where he spoke of UIKit, Foundation, etc.. 
iPhone Development Guide: a brief guide development for iPhone 
Your First iPhone Application: tutorial step by step in creating an application 'HelloWorld' (more comprehensive than this, but in my view introduces too many concepts). 
In any case, our XCode IDE also has direct links to all documentation from Apple ... At the option Help -> Documentation can see that allows us to subscribe to different topics. 
Well, we started to develop. The aim will be to build an application called HelloWorld (yes), which will have a single screen. This will have a label (fixed text), a text field where you can enter information, and a button which, when clicked, will update the value of the label with what we've introduced into the text field. To do this we will perform the following steps: 
Create a project-Based View. XCode we will thus create a class that will handle our ViewController screen. We will see that in Objective-C class ViewController will consist of 2 files extension. H (interface) and. M (implementation). 
We draw the elements of the screen (interface) with Interface Builder, and learn to identify what types correspond to each element (label, text field, button) and changing their appearance, alignment, color ... 
Declare variables in the ViewController, that link to the label and text, and a method for updating the value of the label as introduced in the text box. 
Interface Builder will use to link our checks with the variables and methods created. Ie, view and link controller. 
Schedule certain behaviors and test our application. 
To not extend over this post, following directly in our open XCode and start with Step 1.



Developing on iPhone (2): preparing the environment

Author: jack // Category:

In our previous post we talked about the main differences between developing Web applications and native applications for our iPhone. In this article we will now move on to describe the first steps that will need to take to begin to program your native applications with Objective C. For readers who have already developed native applications for iPhone that will be trivial, but the rest of the users may note that it is rare to find good documentation or tutorials that explain how to start step by step. We try to assist these types of users. 
First, I want to warn that the iPhone SDK distributed by Apple is only available to users with Mac OS X v10.5.4. That is, if you do not have a Mac with Leopard, and want to be a professional developer iPhone, you know what you get. The designs of Steve inexcrutables are ... 
If you meet this prerequisite, he plays downloaded the SDK, namely the development environment. It consists of several programs that they could highlight XCode, the IDE to develop it, Interface Builder, to generate the user interface of our applications, Instruments, in order to assess performance characteristics and behavior of the devices (for example, draw graphic accelerometer) or the iPhone Simulator. The latter will serve to test our code in an iPhone emulation. Then we'll talk about what we do to prove to our own iPhone. 
The SDK is a free download on Apple's developer zone (in English, works better in Safari). To be able to access it must registered as developers, and proceed to download the development kit. It weighs a lot (about 1.3 GB), and go for the version 3.1.1. For each new release of the iPhone firmware is issued a new version of the SDK. 
Once downloaded is installed by clicking on the link "iPhone SDK":


And begins a classic setup wizard:


In principle we can choose what selected by default and wait a few good minutes that everything is installed. The closures will ask you to iTunes, by the way.


Once installed there, as we said, the SDK on your machine. That is, Xcode, iPhone Simulator and other utilities. Now what? Now we can start scheduling. First of all I leave with you a couple of very majas's URL: 
[1] page of sample code from Apple (requires registration): https:/developer.apple.com/iphone/library/navigation/SampleCode.html 
[2] 31 days, 31 applications: appsamuck 
These are pages where you can download sample code, which in our view is without doubt the best choice ... And as a sign of a button, we will download a sample project simple. Sure, the 'Hello World' code example of Apple (see the above link [1]). The application simply makes writing a text, and presents it on screen. The project itself consists of a ZIP decompressed at the location you want. Once we open the downloaded file HelloWorld.xcodeproj:


And this file is opened by our favorite IDE, XCode:

The next article will describe what each file represents, and where "is programmed". In this post let's just assume that we have been able to schedule this example from scratch (not needed in the future), and let's see the result on the iPhone simulator. To do this, simply click on the button 'Build-and-go', the IDE will compile the sources, will open the iPhone Simulator and see "our" application running:


Users pay more attention may ask: what if I want to try on my own iPhone? This has obvious advantages, as you make sure that the application really works, and you can see a real speed network connecting to a 3G or Wifi ... besides having a very interesting applications such as XCode Graphical Debugger or technical support. 
Well, at least you have three options: 
Due to Apple Yes, yes, you can believe, to test your application on your iPhone you have to pay, by registering at the iPhone Developer Program (http://developer.apple.com/iphone/program/). There are two modes: Standard, a 99 €, and Enterprise to 299 €. You can anticipate that in 99.99% of the cases you'll need the cheap version, Standard. The Enterprise is intended for large corporations (more than 500 employees) who want to create proprietary applications in intranet environments. The Standard is enough to be able to upload applications to the AppStore (if approved, of course), distribute your application AppStore without going through the (by URL or email) up to 100 iPhones, and so on. 
Jailbreak your iPhone to do, but we all know that ultimately this is an option for experienced users ... On the Internet there are several references to how to fix this, for example this or this one. 
Get a partner that is already registered in the program and test on yours ... the truth is that there is no greater problem in paying a license among several. The only issue is that the certificate to sign the code is nominal, and you must have good confidence for items that do not occur as happened to the founders of Facebook 
So there we left off. Until the next class, if you know this by little, you can try to download more of such projects and go echándole an eye to the code. Until the next article!

eveloping on iPhone (1): webapps or native applications?

Author: jack // Category:
In ActualidadIphone going to start running a series of posts dedicated to users who intend to make application development for our favorite gadget, of course, iPhone. Although there is a wealth of information already available, we will try to publish a series of simple guides showing, step by step, what is essential to begin to develop our applications. 
Before you start, we could make some considerations: 
If you do not have any training or experience in application development, it probably can move evil. In any case, in this world triumph adventurers 
Most cases go for the 3G iPhone, especially by the large range of possibilities that open with the GPS. 
If you have experience in developing dynamic web applications, namely knowledge of HTML, CSS, javascript, and some language or framework server (PHP, Java, rubyonrails, Python ...), without a doubt have the foundation needed to begin to develop webapps . 
If you have knowledge or experience in development with Objective C (Cocoa, etc.). You can quickly begin to develop native applications for iPhone. Otherwise you will cost more. If someone had said that Objective C is very similar to Java, believe me, this is not the case 
OK, but what is this for webapps and native applications? We will try to clarify these concepts, and list the main advantages and disadvantages of each of these worlds. 
Webapps. The webapps are normal web applications, like any of those already familiar with. They are therefore programmed server languages (PHP, Java ...) that generate HTML with CSS layout and behavior with JavaScript. Applying specific CSS style sheets, we can give our Web applications appear 100% adapted to the iPhone, getting that looks like a desktop application. Apple offers a catalog of various applications, though no doubt most of you have already used, consciously or unconsciously, several: Google web applications (Gmail, Reader, etc.).'s Own mobile version of Facebook, and so on. 
Advantages: 
Do not rely on Apple for us to adopt the high of our application, or to publish a new version that includes new features or correct bugs. 
Users do not need to use our applications Jailbreak, will be accessible via Safari. 
Developing agile and quick. 
No need to learn Objective C. 
If you already have a web application, we can create a Verson iPhone. 
No need to register as an iPhone Developer and pay to start the process of registering an application on AppStore. 
We do not need a Mac to have the IDE development (XCode). Well, for me that's more an inconvenience, but there are still many users of other operating systems 
Disadvantages: 
We do not have natural access to the API's iPhone as camera, GPS, accelerometer, vibration ... there are several initiatives that seek to expose this type of advanced features for API's javascript, with varying degrees of success, but today Apple This has not standardized. 
We have no link to the AppStore, which undoubtedly will lose access to a perfect showcase for our developments. However, we will always be Google 
Native applications. Are the applications that we already know it all and continually since we installed the AppStore (or Cydia for jailbroken iPhones). Being developed with Objective C (although beginning to appear in webapps initiatives to transform native applications). 
Advantages: 
They have total access to the API's referred to as GPS, accelerometer, camera ... 
If we approve Apple (which is much suppose), our application can be accessed from a large number of users. 
We have the option to charge for our application, a simple business model. 
Disadvantages: 
We must develop in Objective C. 
We have to register as Apple developers, and pay for you to test our developments in our own iPhone (!) And be able to send applications for approval in the AppStore. 
In the following posts will start with the development of native applications. Prepare your team!