Moto wrote:
> I would like to remove the dependency to point to "packagename".R
> since I'm trying to merge free and paid apps into one.  The mayor
> problem is the namespace.
> 
> I'm able to get Context.getPackageName()  but how can I convert that
> string to be accessible... i.e. Context.getPackageName().R?

If you are using Eclipse, you may wish to consider setting up a library
project, since that was designed for the paid/free app scenario:

http://developer.android.com/guide/developing/eclipse-adt.html#libraryProject

If that does not fit your needs, call getResources() to get a Resources
object, then call getIdentifier() to get the ID based upon the package
name, etc. Note that this uses reflection and so therefore is slow, so
please cache your results.

-- 
Mark Murphy (a Commons Guy)
http://commonsware.com | http://github.com/commonsguy
http://commonsware.com/blog | http://twitter.com/commonsguy

Android Development Wiki: http://wiki.andmob.org

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to