How do you add user defined properties/values in to the Android manifest file?

You can add meta-data to your AndroidManifest.xml file and then read that in your application. Write the data like so: <meta-data android:value=”bar” android:name=”foo”></meta-data> And read the data like so: ApplicationInfo ai = context.getPackageManager().getApplicationInfo(context.getPackageName(), PackageManager.GET_META_DATA); Object value = (Object)ai.metaData.get(“foo”); See http://developer.android.com/guide/topics/manifest/meta-data-element.html

Same-named attributes in attrs.xml for custom view

Solution: Simply extract common attributes from both views and add them directly as children of the <resources> node: <?xml version=”1.0″ encoding=”utf-8″?> <resources> <attr name=”myattr1″ format=”string” /> <attr name=”myattr2″ format=”dimension” /> <declare-styleable name=”MyView1″> <attr name=”myattr1″ /> <attr name=”myattr2″ /> … </declare-styleable> <declare-styleable name=”MyView2″> <attr name=”myattr1″ /> <attr name=”myattr2″ /> … </declare-styleable> </resources>

techhipbettruvabetnorabahisbahis forumu