Level 3android camp
Maps ,Location-based Services           &    Telephony API
The location-based services facility in Android sits on two pillars:1-mapping using the package com.google.android.maps,2-...
All we need to start is :1-Internet connection2-accept the terms of googleThen , lets develop :D
Understanding the Mapping               Package   Obtain your MD5 fingerprint    Obtaining a map­api Key from Google (tw...
Lets get our MD5   locate your debug certificate
Lets get our MD5keytool -list -alias androiddebugkey -keystore"FULL PATH OF YOUR debug.keystore FILE" -storepass android -...
Get your API-key now   Use the link http://code.google.com/android/maps­     api­signup.html   Then enter your MD5 and a...
Now lets code :D
Now lets code :D                               mainfest.xml<?xml version="1.0" encoding="utf-8"?><manifest xmlns:android="...
Now lets code :D                  add this at your layout<com.google.android.maps.MapView        android:id="@+id/mapview"...
Now lets code :D                              javaActivitypublic class Map2Activity extends MapActivity{    private MapVie...
TELEPHONY APIWith the telephony API you can work with messages , makecalls and use the Internet to make calls VOIP
Now lets make SMS sender          app :D
Send messages   You will use android.telephony.SmsManager class   Dont forget to add the permission      android.permiss...
Sms code                        layout code<?xml version="1.0" encoding="utf-8"?><!-- This file is /res/layout/main.xml --...
<LinearLayout       xmlns:android="http://schemas.android.com/apk/res/android"       android:layout_width="fill_parent"   ...
Sms code                      activity codepublic class SmsActivity extends Activity {/** Called when the activity is firs...
@Overrideprotected void onDestroy() {super.onDestroy();}private void sendSmsMessage(String address, String message)throws ...
I think you know your way            now
Good books you can use   pro android 3 (my best )   OReilly ­ Learning Android   professional android application devel...
thanks         Amar ashour amar_ashour@hotmail.comhttps://www.facebook.com/amar.ashour
android level 3
Upcoming SlideShare
Loading in...5
×

android level 3

1,904

Published on

level 3 @ android camp @ devent 3 by amar ashour

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

No Downloads
Views
Total Views
1,904
On Slideshare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
167
Comments
0
Likes
1
Embeds 0
No embeds

No notes for slide

android level 3

  1. 1. Level 3android camp
  2. 2. Maps ,Location-based Services & Telephony API
  3. 3. The location-based services facility in Android sits on two pillars:1-mapping using the package com.google.android.maps,2-Location-based APIs.using the package android.location APIs
  4. 4. All we need to start is :1-Internet connection2-accept the terms of googleThen , lets develop :D
  5. 5. Understanding the Mapping Package Obtain your MD5 fingerprint  Obtaining a map­api Key from Google (two keys) one for  development with the emulator and another for production  Understanding MapView and MapActivity
  6. 6. Lets get our MD5 locate your debug certificate
  7. 7. Lets get our MD5keytool -list -alias androiddebugkey -keystore"FULL PATH OF YOUR debug.keystore FILE" -storepass android -keypass androidEnter the password : android(only if asked)
  8. 8. Get your API-key now Use the link http://code.google.com/android/maps­ api­signup.html Then enter your MD5 and accept the terms
  9. 9. Now lets code :D
  10. 10. Now lets code :D mainfest.xml<?xml version="1.0" encoding="utf-8"?><manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.ashour.amar.map3" android:versionCode="1" android:versionName="1.0" > <uses-sdk android:minSdkVersion="4" /> <uses-permission android:name="android.permission.INTERNET" /> <application android:icon="@drawable/ic_launcher" android:label="@string/app_name" > <uses-library android:name="com.google.android.maps" /> <activity android:label="@string/app_name" android:name=".Map3Activity" > <intent-filter > <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> </activity> </application>
  11. 11. Now lets code :D add this at your layout<com.google.android.maps.MapView android:id="@+id/mapview" android:layout_width="fill_parent" android:layout_height="wrap_content" android:apiKey="0HjFnVeWB501OoE879ht4U35shuIsabH6M5UUUw" android:clickable="true" />
  12. 12. Now lets code :D javaActivitypublic class Map2Activity extends MapActivity{ private MapView mapView;private GeoPoint pt;/** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); mapView = (MapView)findViewById(R.id.mapview); mapView.setBuiltInZoomControls(true); } @Override protected boolean isLocationDisplayed() { return true; }@Overrideprotected boolean isRouteDisplayed() {return true;}}
  13. 13. TELEPHONY APIWith the telephony API you can work with messages , makecalls and use the Internet to make calls VOIP
  14. 14. Now lets make SMS sender app :D
  15. 15. Send messages You will use android.telephony.SmsManager class Dont forget to add the permission  android.permission.SEND_SMS
  16. 16. Sms code layout code<?xml version="1.0" encoding="utf-8"?><!-- This file is /res/layout/main.xml --><LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:orientation="vertical" > <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="wrap_content" android:orientation="horizontal" > <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Destination Address:" /> <EditText android:id="@+id/addrEditText" android:layout_width="fill_parent" android:layout_height="wrap_content" android:phoneNumber="true" android:text="01095996548" /> </LinearLayout>
  17. 17. <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="wrap_content" android:orientation="vertical" > <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Text Message:" /> <EditText android:id="@+id/msgEditText" android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="hello sms" /> </LinearLayout> <Button android:id="@+id/sendSmsBtn" android:layout_width="wrap_content" android:layout_height="wrap_content" android:onClick="doSend" android:text="Send Text Message" /></LinearLayout>
  18. 18. Sms code activity codepublic class SmsActivity extends Activity {/** Called when the activity is first created. */@Overrideprotected void onCreate(Bundle savedInstanceState) {super.onCreate(savedInstanceState);setContentView(R.layout.main);}public void doSend(View view) {EditText addrTxt = (EditText) findViewById(R.id.addrEditText);EditText msgTxt = (EditText) findViewById(R.id.msgEditText);try {sendSmsMessage(addrTxt.getText().toString(), msgTxt.getText().toString());Toast.makeText(this, "SMS Sent", Toast.LENGTH_LONG).show();} catch (Exception e) {Toast.makeText(this, "Failed to send SMS", Toast.LENGTH_LONG).show();e.printStackTrace();}}
  19. 19. @Overrideprotected void onDestroy() {super.onDestroy();}private void sendSmsMessage(String address, String message)throws Exception {SmsManager smsMgr = SmsManager.getDefault();smsMgr.sendTextMessage(address, null, message, null, null);}}
  20. 20. I think you know your way now
  21. 21. Good books you can use pro android 3 (my best ) OReilly ­ Learning Android professional android application development Pro   Android Media Developing Graphics 
  22. 22. thanks Amar ashour amar_ashour@hotmail.comhttps://www.facebook.com/amar.ashour
  1. A particular slide catching your eye?

    Clipping is a handy way to collect important slides you want to go back to later.

×