Monday, 5 August 2013

Mobile App Developer's Point Of View

As a mobile app developer, there are a few things to be kept in mind:

1. Your primary goal is not finishing/completing the app,
    It should be:
  - How to make users download your app, What makes your app unique that is gets downloaded more.
  - If your app is one outta 10 downloads for a user, What makes it special that user uses your app most                        
    out of the ten which are already downloaded.
  - A mobile phone user may not use a phone for more than 2-3 hours a day for leisure time, Your app
    must be addictive enough to make the user engage a particular window time everyday.

2. Your app's code need not be very complex.
  - The more simple the code, the less to debug & less number of crashes.

3. Your app MUST be user friendly.
  - If it is a game, user is not going to spend time learning the different controls.
  - The user may spend a max. of 1-2min to figure out controls else he moves on saying it is too    
    complex to understand.

More to Come :) (Attended IAMAI's Appfest 2013 @ IIM Ahmedabad where i picked up a few things)

Saturday, 6 July 2013

How Xcode works (Basics for Amateurs) Part I

Xcode is a mere IDE or platform to test or to execute various languages.

It supports C, C++, Obj C, Java, Python, Pearl, etc.

It is mainly used for MAC app development & iOS development.

Under iOS, it works as a MVC structure, which is MODEL VIEW CONTROLLER structure.

for iOS we basically use VIEW CONTROLLER alone.

So a project when opened as iOS project will have various files such as

The hierarchy works like this :

The main files we are gonna use would be the ViewController.h, ViewController.m & ViewController.xi.b files.

The .h file is the interface file where we will be declaring all of our variables and methods (similar to that of abstract class is java)

The .m file is were the implementation is defined for all the variables and methods declared in the interface file.

The .xib file is similar to .xml file in eclipse for android development, where we add objects and map them to the variables and functions which we have declared already.

The supporting files folder may include the pictures which we may add to the app as background, etc.

The Frameworks folder contain built in frameworks which we need to add inorder to make use of them in the coding.
Apart from this new frameworks or third party frameworks can also be added to this folder or by adding them as a separate group to the project.

Delegates are nothing but predefined modules for particular functions which we may use in the app. dev. and they must be included within <> in the .h file inorder to use them.
Consider them similar to packages in JAVA where if we want to use them we import them into the java program, but here we include them in <> in the .h file.

More to come in future as I myself am learning it only now:) if anybody wants specific parts of Xcode to be discussed please add comment :) I'l try my best to give you answers :) Cheers



Tuesday, 18 June 2013

Implementing Admob onto your iOS App

Usually iAd is used as the advertisement portal for including ads on your iOS apps. But iAd is not supported in all countries and Google's admob has a wide range of network.

Here are some simple steps to follow in Xcode to include admob ads on your app.

1. Considering that you have already created your app, you need to add few lines of code and header files onto your controller.h file of the app.

  •  #import <UIKit/UIKit.h>
    #import "GADBannerView.h"

    @interface ViewController : UIViewController{
         GADBannerView *bannerView_;
    }

    @end


2. Few App Frameworks are to be added to app. They are required to make the ad work.

  • Under Build Phases>Link Binary with Libraries>add the following frameworks.
  • AudioToolbox.Framework
  • CodeGraphics.Framework
  • SystemConfigurateion.Framework
  • MessageUI.Framework


3.You need to integrate the admob's SDK for iOS onto you app bundle. This is done by adding a New Group to the app

  • Right click your app name > New Group > name it 'Admob'.
  • Click File>Add Files (with the group name highlighted) > Navigate to location of SDK.
  • Now the SDK files are linked onto your app.

3. The code to be added to your main program

- (void)viewDidLoad
{
    [super viewDidLoad];
    bannerView_ = [[GADBannerView alloc] initWithAdSize:kGADAdSizeBanner];
    
    // Specify the ad's "unit identifier". This is your AdMob Publisher ID.
    bannerView_.adUnitID = @"YOUR UNIQUE ID";
    
    // Let the runtime know which UIViewController to restore after taking
    // the user wherever the ad goes and add it to the view hierarchy.
    bannerView_.rootViewController = self;
    [self.view addSubview:bannerView_];
    
    // Initiate a generic request to load it with an ad.
    [bannerView_ loadRequest:[GADRequest request]];

// Do any additional setup after loading the view, typically from a nib.
}


4. You need to be a registered member of Admob to get a valid ID for every ad you make, for every App. It has to be activated in the website to be executed in the app.

Once the above steps have been followed successfully, the ad will we displayed as preferred :)

Thursday, 13 June 2013

Deployment of Apps (Mac)

It's comparatively easy to use a Mac to develop iOS Apps.

Things you will need:
1. A Mac with OSx installed in it.
2. Xcode.
3. iOS latest library files.
4. iOS developer certificate.

Step I: If you have a Mac with OSx installed in it go ahead and download Xcode from the App Store, it's absolutely free of cost and is quiet a large App therefore it may take time.


Step II: Once you have Xcode installed, open it and choose the properties of your App i.e. Orientation Type, iOS version, distribution type and so on, al these and more asked when you give File>New Project.





Step III: You need sound knowledge of Objective C to code your apps, the hierarchy and file structure of the App gets arranged by default towards the left side of your window on the mac and your good to go to code your App.

Step IV : Once you'v created the app you can use the simulator to test it by building your app on Xcode itself.

Step V: Once you have finalised your App, you use your certificate to generate the .ipa file. (Note : You NEED the certificate to develop the .ipa file so as to deploy it in a real device. It costs 99$ per year and can be purchased at www.developer.apple.com)

Step VI: Once you have the file generated, you can sync it using iTunes on to your idevice.


Wednesday, 12 June 2013

Deployment of Apps (Windows)

Most people think that u DEFINITELY need a MAC to develop an iOS app (be it for the iPhone, iPad or itouch) but the truth is there are ways to get going with windows.

Though I'm totally against it, I was desperate to create an app for the idevice i had (itouch 4g) and at that time i did not own a MAC.

I googled around and found bits and pieces of how to do it on windows and here are the steps to successfully deploy an app on an idevice (obviously jailbroken idevice) using Flash CS5 on Windows.

Step I: Download Flash CS5 for Windows, get it installed.


Step II: Convert your apple developer certificate into a .p12 certificate so that it gets accepted by adobe CS5 (http://help.adobe.com/en_US/as3/iphone/WS144092a96ffef7cc-371badff126abc17b1f-7fff.html).

Step III: Use action script to do your coding for your app.
Note: Make sure to increase object code to move stuff around on a screen instead of moving them using frames because frames would make the app large in size.

Step IV: Use the .p12 certificate in the flash cs5's properties by browsing to it's location and generate the .ipa file once you'v designed your app. (it's easy following on screen instructions but if u need any help do ask)

Step IV: Getting the app into the idevice is a little tricky; you will need
(i) Cydia
(ii)ifile.

(i) If you have jailbroken your device, go to Cydia download app sync for your version of iOS (e.g.: AppSync 4.2.*) and transfer the app onto the device using ifile.
Once you have done the above two tasks, sync the app by browsing to it and by using app Sync.
The other way of doing it which is illegal is syncing it using iTunes (cause your app was not registered officially at the app store).

Either way the app gets deployed and you can test yo development apps.

Next Blog Deployment using MAC :)