Android Interview (2)----components

Source: Internet
Author: User

The role of 1.anroid:id?

The Android:id is the unique identifier for the control. You can use it with releativelayout, or you can then get the specified control through Findviewbyid in the activity.

The difference between 2.android:padding and Android:layout_margin.

Padding is internal, while margin is external.

Padding partial settings background can be overwritten, and margin cannot be overwritten.

3.Imagebutton & ImageView

Imagebutton extern imageview.

4. How do I invoke the activity?

Show Call:

New Intent (this, myactivity. class  New  Intent (com.xxx.app.launch); startactivity (Intent);

5.avtivity directly how to pass data?

For simple passing through the intent.

Clipboard, global variables, static objects, and so on.

6. How do I turn activity into a dialog box?

Use Theme.dialog to set the properties of the activity in Androidmanifest.xml.

7. How do i show activity over animation?

Overridependdingtranslation (R.am.fadein, r.am.fadeout);

8. How do I intercept a call?

Listen to the call broadcast: telephone.sms_received

Judge Getcallingstatus:ring.

Endcall ();

9. How do i show the activity after booting?

Monitor boot_completed Broadcast

In the OnReceive

Start Intent:FLAG:intent.setFlag (intent_flag_new_task);

10.service Development aidl steps?

1) Create a aidl file in eclipse

2) Android will automatically generate a *.java file.

3) Private class Imagesearchbuildserviceimpl extends Ibuildservice.stub

Create an internal class Imagesearchbuildserviceimpl interface that implements Bind.

Returns the class of Bind:

     Public ibinder onbind (Intent Intent) {        = Intent.getlongextra ("Cookie", -1);         [Onbind] Mcurrentcookie: "+Mcurrentcookie);         New Imagesearchbuildserviceimpl (mimagesearchoperator);         return Iserviceimpl;    }

4) Configure the service in Androidmanifest.xml.

What data does 11.AIDL support?

Aidl supports Java simple types (Int,char,boolean, etc.)

String and Charqueue

List and map

Android.os.Pracelable

What are the components of the 12.ContentProvider URL?

1) content://

2) Authority

3) path

4) param

Content://mobile.android.mydata/product/20

Android Interview (2)----components

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.