• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Apps Android application as module for another application

QuickNick

Newbie
Good day, friends.

Let's suppose we have three applications.
1)Application A has 1 activity that writes "Hello, World!" message.
2)Application B has 1 activity that writes "To be or not to be." message.
3)Application C has two tabs: 1st tab as the activity writes "Hello, World!" message, 2nd tab as the activity writes "To be or not to be." message.

Activities in application A and first tab of C are identical. Activities in application B and second tab of C are identical too.

I have an idea to make two libraries (they would use android.jar) - one library is for the activity "Hello, World!" and another is for the activity "To be or not to be". Application A would invoke 1st library, B - 2nd library, C - both of them.
But, as I've continued to think it out, there is a problem with R-class. On the one hand, we should include a part of R-class in the every library, we should some way generate R-file by data files (audio, pictures and so on) in the library - otherwise we'll not compile them. On the other hand, how to combine 1 or more R-classes from the libraries to one R-class in the application?

P.S.: the variant with a content-provider and launching of another application isn't acceptable.
 
I dont think you can host other apps in an app like that. I could be wrong but I have never seen more than one app occupy the foreground before. I dont think Android is designed that way.

However, you may want to look at the PackageManager class

PackageManager | Android Developers

There are some methods in that class that might be what you're looking for.
such as:
public abstract Resources getResourcesForApplication (ApplicationInfo app)

and

public abstract int checkSignatures (String pkg1, String pkg2)



hth
 
Back
Top Bottom