Your SlideShare is downloading. ×
Basic android workshop
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×

Introducing the official SlideShare app

Stunning, full-screen experience for iPhone and Android

Text the download link to your phone

Standard text messaging rates apply

Basic android workshop

1,379
views

Published on

Introduction to Android and a walk through of developing a simple android application. http://thagatpam.com

Introduction to Android and a walk through of developing a simple android application. http://thagatpam.com

Published in: Technology

0 Comments
4 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
1,379
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
0
Comments
0
Likes
4
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. Developing Applications for Android Platform
    Jayakumar Palanivel
    Founder & Director
    Thagatpam Tech
  • 2. Agenda
    • Smart phones: Trends, Technology and Market
    • 3. Why Android
    • 4. Android Architecture
    • 5. Developing Applications for Android
    • 6. Environment
    • 7. SDK
    • 8. Market
    • 9. Sample App
  • Indian Mobile Internet Market
    India’s internet users will increase fivefold by 2015, and more than three quarter of them will choose mobile access
  • 10. Smart Phones: Market
    • Big increase in Smart Phone sales >80million/quarter
    • 11. > 5Lakhs apps
    • 12. Huge potential : eBay to make $2billion from sales via mobile channel
  • Smart Phones: Technology
    • Internet enabled, GPS, Accelerometers, Gyroscopes, Big touch screens => New Application Possibilities
    • 13. Complete OS(iOS, Android) with Application SDK Support
    • 14. Smart phones today = PCs two decades ago = Lot of potentials
  • Android
    • Complete OS for Mobile Internet Handheld devices
    • 15. From Google and Open Handset Alliance
    • 16. Free and Open Source, Linux based.
    • 17. Adapted by many device makers
    • 18. Application SDK
  • Why Android
    • Open source and free, hence it will see wider adoption by device makers.
    • 19. It is already the largest deployed mobile OS for smart phones
    • 20. Capable of running in Tablets, eBook Readers, etc...
    • 21. Good community support
    • 22. It's from Google
  • Android Architecture
  • 23. Developing for Android
    • Android provides SDK for Application development
    • 24. Java
    • 25. Dalvik VM
    • 26. Reusable libraries
  • Development environment
    Your development environment is preloaded in Ubuntu Virtual Machine
  • 27. Emulator
  • 28. Android SDK Model
    Activities
    View
    Services
    Notifications
    Content Providers
    Intents
    AndroidManifest.xml
  • 29. Activities
    • Activity manages screens
    • 30. UI Layout
    • 31. Lifecycle & Behaviour
    • 32. Related data
    • 33. Similar to forms in HTML
    • 34. Multiple activities can be live
    • 35. But only one is active and visible
  • Activity Lifecycle
  • 36. Views
    • Basic UI building blocks for
    • 37. Responds to events
    • 38. Can be grouped as View Trees for creating complex UI
    • 39. Can be defined in XML – Recommended
    • 40. Can be defined in program too – Not recommended
  • Intents
    • Used to move from activities to activities
    • 41. Provides parameters for the activities to use
    • 42. Consists of intended action and the data from previous activity.
    • 43. Similar to request object in HTTP protocol
  • Services
    • Run in the background
    • 44. Example : Media player
    • 45. No user interaction
    • 46. Used to expose common functionalities to other applications
  • Notifications
    • Notifies users about different events
    • 47. SMS Received
    • 48. New mail arrived
    • 49. Sent through NotificationManager
    • 50. Types
    • 51. Persistent icon
    • 52. Turning LEDS
    • 53. Sound or Vibration
  • Content Providers
    • Persistent data storage mechanism
    • 54. Store
    • 55. Retrieve
    • 56. Only way to make data available across applications
    • 57. Supports File system or SQLite.
    • 58. Mostly SQLite
    • 59. Data exposed as unique URI
  • The First App : Say Hello
    • Star Eclipse
    • 60. Create new android project
    • 61. New -> Project
  • The First App : Say Hello
    • By default eclipse generates the “Hello Android” application.
    • 62. Run it by clicking RMB and select “Run as Android Applications”
  • Application Structure
  • A Real App: MySMS
    Create a new Android Project
    • Project Name : com.tpm.android.sms
    • 69. Build Target : Google API 1.6 (API Level 4)
    • 70. Application Name : MySMS
    • 71. Package Name : com.tpm.android.sms
    • 72. Activity : MySMS
  • Edit Layout
    - Navigate to res/layout/main.xml
    - Replace the content with the following
    <?xmlversion="1.0"encoding="utf-8"?>
    <LinearLayoutxmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="vertical"android:layout_width="fill_parent"
    android:layout_height="fill_parent">
    <TextViewandroid:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:text="@string/enter_sms"/>
    <EditTextandroid:id="@+id/body"android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:scrollbars="vertical"/>
    <Buttonandroid:id="@+id/confirm"
    android:text="@string/confirm"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"/>
    </LinearLayout>
  • 73. Edit String Resources
    Open res/values/strings.xml and add the following string resources
    <stringname="enter_sms">Enter SMS Text</string>
    <stringname="confirm">Send SMS</string>
  • 74. Activity Coding
    Open src/com.tpm.android.sms/MySMS.java and insert a class member
    privateEditTextmSmsText;
    Create a new OnClick Event Listener Class
    publicclassOnClickListenerimplementsView.OnClickListener {
    @OverridepublicvoidonClick(View v) {
    String sms = mSmsText.getText().toString();
    if (sms == null || sms.trim().length() ==0) {
    Toast.makeText(v.getContext(),
    "Enter a message", Toast.LENGTH_LONG).show();
    } else {
    Toast.makeText(v.getContext(),
    "SMS Sent : " + sms , Toast.LENGTH_LONG).show();
    }
    }
    }
  • 75. Activity Coding
    Edit OnClick Method as shown below
    public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.main);
    mSmsText = (EditText)findViewById(R.id.body);
    Button confirmButton = (Button) findViewById(R.id.confirm);
    confirmButton.setOnClickListener(new OnClickListener());
    }
    Compile and Run.
  • 76. For on More Android
    http://developer.android.com
    Or you can reach us at http://thagatpam.com