Your SlideShare is downloading. ×
0
Mobile Software Engineering Crash Course - C04 Android Cont.
Mobile Software Engineering Crash Course - C04 Android Cont.
Mobile Software Engineering Crash Course - C04 Android Cont.
Mobile Software Engineering Crash Course - C04 Android Cont.
Mobile Software Engineering Crash Course - C04 Android Cont.
Mobile Software Engineering Crash Course - C04 Android Cont.
Mobile Software Engineering Crash Course - C04 Android Cont.
Mobile Software Engineering Crash Course - C04 Android Cont.
Mobile Software Engineering Crash Course - C04 Android Cont.
Mobile Software Engineering Crash Course - C04 Android Cont.
Mobile Software Engineering Crash Course - C04 Android Cont.
Mobile Software Engineering Crash Course - C04 Android Cont.
Mobile Software Engineering Crash Course - C04 Android Cont.
Mobile Software Engineering Crash Course - C04 Android Cont.
Mobile Software Engineering Crash Course - C04 Android Cont.
Mobile Software Engineering Crash Course - C04 Android Cont.
Mobile Software Engineering Crash Course - C04 Android Cont.
Mobile Software Engineering Crash Course - C04 Android Cont.
Mobile Software Engineering Crash Course - C04 Android Cont.
Mobile Software Engineering Crash Course - C04 Android Cont.
Mobile Software Engineering Crash Course - C04 Android Cont.
Mobile Software Engineering Crash Course - C04 Android Cont.
Mobile Software Engineering Crash Course - C04 Android Cont.
Mobile Software Engineering Crash Course - C04 Android Cont.
Mobile Software Engineering Crash Course - C04 Android Cont.
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

Mobile Software Engineering Crash Course - C04 Android Cont.

468

Published on

Published in: Education
0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
468
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
14
Comments
0
Likes
1
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

  • 1. Mobile Software EngineeringL04 – Android Cont. Mohammad Shaker FIT of Damascus - AI dept. MohammadShakerGtr@gmail.com Mobile SE – August 2012
  • 2. ActivitiesStarting Another Activity
  • 3. Intentan object that provides runtime binding between separate components (such as two activities)
  • 4. Intentcarry a collection of various data types as key-value pairs called extras through putExtra()
  • 5. It’s a good practice..to define keys for intent extras using your apps package name as a prefix. This ensures they are unique, in case your app interacts with other apps.
  • 6. Starting Another Activityhttp://developer.android.com/training/basics/firstapp/starting-activity.html#BuildIntent Project Attached
  • 7. Starting Another Activitypublic final static String EXTRA_MESSAGE ="com.example.intetsample.MESSAGE";public void sendMessage(View view) { Intent intent = new Intent(this, DisplayMessageActivity.class); EditText editText = (EditText) findViewById(R.id.editText1); String message = editText.getText().toString(); intent.putExtra(EXTRA_MESSAGE, message); startActivity(intent); }
  • 8. AndroidManifest.xml
  • 9. AndroidManifest.xml<application android:icon="@drawable/ic_launcher" android:label="@string/app_name" android:theme="@style/AppTheme" > <activity android:name=".MainActivity" android:label="@string/title_activity_main" > <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> </activity> <activity android:name=".DisplayMessageActivity" android:label="@string/title_activity_display_message" > <meta-data android:name="android.support.PARENT_ACTIVITY" android:value="com.example.intetsample.MainActivity" /> </activity> </application>
  • 10. Managing the Activity Life Cycle
  • 11. Destroy the activity onDestroy()
  • 12. Destroy the activity
  • 13. onPasue() @Override public void onPause() { // Always call the superclass method first super.onPause(); // Release the Camera because // we dont need it when paused // and other activities might need to use it. if (mCamera != null) { mCamera.release() mCamera = null; } }
  • 14. onResume() @Override public void onResume() { // Always call the superclass method first super.onResume(); // Get the Camera instance as the activity // achieves full user focus if (mCamera == null) { // Local method to handle camera init initializeCamera(); } }
  • 15. Recreating activity onSaveInstanceState
  • 16. Storage – Database Sqlite3
  • 17. Draggable stick project sample attached
  • 18. OpenGL ES
  • 19. How can we animate?
  • 20. Must Override a Superclass Method Errors after importing a project into Eclipse Problemhttp://stackoverflow.com/questions/1678122/must-override-a-superclass- method-errors-after-importing-a-project-into-eclips
  • 21. @Overridepublic boolean onTouchEvent(MotionEvent e) { float x = e.getX(); float y = e.getY(); switch (e.getAction()) { case MotionEvent.ACTION_MOVE: float dx = x - mPreviousX; float dy = y - mPreviousY; // reverse direction of rotation above the mid-line if (y > getHeight() / 2) { dx = dx * -1 ; } // reverse direction of rotation to left of the mid-line if (x < getWidth() / 2) { dy = dy * -1 ; } mRenderer.mAngle += (dx + dy) * TOUCH_SCALE_FACTOR; // = 180.0f / 320 requestRender(); } mPreviousX = x; mPreviousY = y; return true;}
  • 22. Let’s get our hands dirty with code!
  • 23. Advanced Training• Making Your App Location Aware• Performing Network Operations• Transferring Data Without Draining the Battery• Syncing to the Cloud• Designing for Multiple Screens• Improving Layout Performance• Managing Audio Playback• Optimizing Battery Life• Creating Custom Views• Adding Search Functionality• Remembering Users• Sharing Content• Capturing Photos• Maintaining Multiple APKs• Creating Backward-Compatible UIs• Developing for Enterprise• Monetizing Your App• Designing Effective Navigation• Implementing Effective Navigation• Designing for TV• Displaying Bitmaps Efficiently• Implementing Accessibility• Displaying Graphics with OpenGL ES
  • 24. See you nxt time!

×