0

I would like to modify the existing source of the android sdk, so for instance, in LinearLayout and say put an print message or adding some paddings to the constant

so is there a way i can create a new android app, and have it depends on the sdk source instead of choosing a sdk in projection creation.

thanks

4

3 回答 3

0

The Android SDK provides you the API libraries and developer tools necessary to build, test, and debug apps for Android.

Even if you modify it, rebuild it, and build your application against this modified version when you install it on a real device your application won't be able to find your modifications.

于 2013-04-05T04:12:54.943 回答
0

Yes you can, all views in android are in form of classes which can be extended ad new views or custom views with custom parameters can be formed and used in your app.

于 2013-04-05T04:14:02.207 回答
0

You can extend LinearLayout, or extend a ViewGroup class (which is what all standard layouts extend). In layout xml you can declare it as a custom view:

<com.example.MyLayout
       adnroid:layout_width="..." 
 ... >

</com.example.MyLayout>

My problem was that inflater ignored all children under my custom layout. Maybe I did something wrong, and you will be luckier :) In the worst scenario you may have a separate layout xml for children and add it programmatically after inflating.

Embedding your own layout into Android system is not a good practice for a mere reason that in that case you will have to supply a modified Android system to all users of your app :)

于 2013-04-05T05:24:30.450 回答