Whats the difference between a NSArray and a NSMutableArray?
Correct Answer
A NSArray?s contents can not be modified once it?s been created whereas a NSMutableArray can be modified as needed, ie items can be added/removed from it
Correct Answer: For launching an application, we will need to create an intent that explicitly defines the activity that we wish to start For example: Code Intent intent = new Intent(this, MyTestActivityclass); startActivity(intent);
3. How can your application perform actions that are provided by other application e.g. sending email?
Correct Answer: Intents are created to define an action that we want to perform and the launches the appropriate activity from another application Code Intent intent = new Intent(IntentACTION_SEND); intentputExtra(IntentEXTRA_EMAIL, recipientArray); startActivity(intent);
4. Write code snippet to retrieve IMEI number of Android phone?
Correct Answer: TelephonyManager class can be used to get the IMEI number It provides access to information about the telephony services on the device Code TelephonyManager mTelephonyMgr = (TelephonyManager) getSystemService(ContextTELEPHONY_SERVICE); String imei = mTelephonyMgrgetDeviceId();
5. How does an application run in isolation from other applications?
Correct Answer: Each application gets its own Linux user ID and virtual machine which means that the application code runs in isolation from other applications
6. If I call performSelector:withObject:afterDelay: ? is the object retained?
Correct Answer: Yes the object is retained It creates a timer that calls a selector on the current threads run loop It may not be 100% precise time-wise as it attempts to dequeue the message from the run loop and perform the selector
7. Explain the correct way to manage Outlets memory?
Correct Answer: Create them as properties in the header that are retained In the viewDidUnload set the outlets to nil(ie selfoutlet = nil) Finally in dealloc make sure to release the outlet
8. Where can you test Apple iPhone apps if you don?t have the device?
Correct Answer: iOS Simulator can be used to test mobile applications Xcode tool that comes along with iOS SDK includes Xcode IDE as well as the iOS Simulator Xcode also includes all required tools and frameworks for building iOS apps However, it is strongly recommended to test the app on the real device before publishing it
9. Which API is used to write test scripts that help in exercising the application's user interface elements?
Correct Answer: UI Automation API is used to automate test procedures Tests scripts are written in JavaScript to the UI Automation API This in turn simulates user interaction with the application and returns log information to the host computer
10. Assume that your app is running in the foreground but is currently not receiving events. In which sate it would be in?
Correct Answer: An app will be in InActive state if it is running in the foreground but is currently not receiving events An app stays in InActive state only briefly as it transitions to a different state