Wednesday, September 28, 2011

Weak link in iphone SDK


Well, there happened a case when I was using the latest iOS SDK  for the development purpose, and built an application which utilized the eventKit framework, and the framework used "eventKit" was a new addition to the framework list.

I used the eventKit on the fly and submitted to the appstore for the approval process, and as a matter the application was approved.

But, the case happened when the application was being downloaded and it used to crash at the app launch on the earlier iOS's.

Digging around the problem, I came to know about the weak link thing for a framework, and uploaded the updated build to app store.

The idea is that, If you are using a framework that is not available to all the devices that you have selected as target devices, make the framework as weak link.

This can be done as below:
* Select the project target > Right click > Get-Info.
* Go to general tab > Linked libraries.
* Select the framework and make it a weak link.



Also, keep in if you mark a framework as weak linked, be sure to check for its availability before using any of its functionally.

You can check for the existence of the class like below code sample:

Class theClass = (NSClassFromString(@"UILocalNotification"));
if(theClass){
// Class exists
}
else{
// Class does not exists
}

Saturday, September 24, 2011

List of Android emulator shortcuts

Android development is like cream, handling the emulator is on the other side.
Android emulator almost covers up the screen. In some cases you may not even see the 
'Home' button of the emulator screen, like on screens with resolution 1366 x 768.
Using android emulator shortcuts is the best way to get rid of such problems. Using shortcuts may
also increase the speed at which you work with the emulators.
Thus regardless of the screen resolution use of android emulator shortcuts is always encouraged.


Here is a list of android emulator shortcut keys:

Escape Back button
Home Home button
F2         PageUp Menu button
Shift-F2         PageDown Start button
F3         Call/Dial button
F4         Hangup/EndCall button
F5         Search button
F7         Power button
Ctrl-F3 Ctrl-KEYPAD_5 Camera button
Ctrl-F5 KEYPAD_PLUS Volume up button
Ctrl-F6 KEYPAD_MINUS Volume down button
KEYPAD_5         DPAD center
KEYPAD_4          DPAD left
KEYPAD_6          DPAD right

KEYPAD_8          DPAD up
KEYPAD_2          DPAD down
F8         Toggle cell network on/off
F9         Toggle code profiling (when -trace set)
Alt-ENTER         Toggle fullscreen mode
Ctrl-T Toggle trackball mode
Ctrl-F11, KEYPAD_7 Rotate screen orientation to previous or next layout
Ctrl-F12, KEYPAD_9 Rotate screen orientation to previous or next layout


And now, Start using the shortcuts...