Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Android Lab Test : Using the Intent Dial (english)

382 views

Published on

Android Lab Test : Using the Intent Dial (english)
Video of tutorial on : https://www.youtube.com/playlist?list=PLL2Z3bzdO25yHwIV3XdMzKs61At0Ldh6L
Visit http://www.AndroidLabTest.com

Published in: Education
  • D0WNL0AD FULL ▶ ▶ ▶ ▶ http://1lite.top/Tq9lV ◀ ◀ ◀ ◀
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • D0WNL0AD FULL ▶ ▶ ▶ ▶ http://1lite.top/Tq9lV ◀ ◀ ◀ ◀
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • Be the first to like this

Android Lab Test : Using the Intent Dial (english)

  1. 1. Develop on Android Android Lab Test www.AndroidLabTest.com Youku By Bruno Delb www.weibo.com/brunodelb i.youku.com/brunodelb | www.weibo.com/brunodelb | blog.delb.cn http://i.youku.com/brunoparis Weibo Officialsite Lesson : The Intents, Dial
  2. 2. The Intents, Dial • In this lesson, you will learn to launch the phone number dialer. • For this, you will use the Intents.
  3. 3. The Intents, Dial • The method startActivity starts an activity. • This activity is an Intent. • The Intent launched is ACTION_DIAL. It’s a phone number dialer. startActivity ( new Intent (Intent.ACTION_DIAL, Uri.parse ("tel:0606060606")) );
  4. 4. Layout main.xml <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent"> <TextView android:text="Phone number to dial:" android:layout_width="wrap_content" android:layout_height="wrap_content" /> <EditText android:id="@+id/et_number" android:layout_width="fill_parent" android:layout_height="wrap_content" android:cursorVisible="true" android:editable="true" android:singleLine="true" />
  5. 5. Layout main.xml <Button android:id="@+id/btn_dial" android:text="Dial" android:layout_width="fill_parent" android:layout_height="wrap_content" /> </LinearLayout>
  6. 6. File Main.java public class Main extends Activity { EditText etNumber; public void onCreate (Bundle icicle) { super.onCreate (icicle); setContentView (R.layout.main); etNumber = (EditText)findViewById (R.id.et_number); Button btnDial = (Button)findViewById (R.id.btn_dial); btnDial.setOnClickListener (new Button.OnClickListener() { public void onClick (View view) { startActivity (new Intent (Intent.ACTION_DIAL, Uri.parse ("tel:" + etNumber.getText().toString()))); } }); } }
  7. 7. Test on your mobile Intent_Dial
  8. 8. Follow me on my channel PengYooTV … On my Youku channel http://i.youku.com/brunoparis Who am I ? Bruno Delb (www.delb.cn), Author of the first french book of development of Java mobile application (2002), Consultant, project manager and developer of social & mobile applications, let’s talk about your needs ... And on Weibo : http://www.weibo.com/brunodelb

×