Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

what are the ways to build app as a reusable module

 
sam liya
Ranch Hand
Posts: 1243
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I need to build an app which is can be as a reusable app(module).what are the ways of doing this?
 
Ulf Dittmer
Rancher
Posts: 42969
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What do you mean by "reuse" in this context? How would that work?
 
sam liya
Ranch Hand
Posts: 1243
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i need to create a app which can be call from other apps.But this app contain gridview
 
Ulf Dittmer
Rancher
Posts: 42969
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The usual approach to inter-app communication is to use Intents: http://developer.android.com/guide/components/intents-filters.html. What kinds of GUIs the two sides use is irrelevant.
 
sam liya
Ranch Hand
Posts: 1243
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
can you provide me an example.
1)can we reuse a app trying to do it as a library?
 
Ulf Dittmer
Rancher
Posts: 42969
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Start by writing two trivial apps that use Intents to communicate with one another using. You would use explicit Intents (since you're targeting specific apps) and startActivityForResult (since you expect a result). I'm sure searching for "android inter-app communication by intent" or some such phrase will find examples.
 
sam liya
Ranch Hand
Posts: 1243
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i need to do this ULF.There is a main app which contain a set of images.when i click one of them it must call the relevant app.but the thing is that the number of apps in main app changes time to time.So we can't use Inten.If we use intent we need to know the main class of app or at least package of main class.in this situation the number of link changes.
 
Ulf Dittmer
Rancher
Posts: 42969
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
So the main app needs to keep track which other apps there are, and which classes in those would be addressees of the intent. No big deal.

I don't see how that precludes using intents; please explain why you think that. You will anyway end up using them, because that's the way to do inter-app communication in Android. Don't fight the OS, learn how to use it.
 
Rehan Zahoor
Ranch Hand
Posts: 83
Android Java Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Service as I understand so far, is a way to reuse code/modules in android. If a service is available it can be called by the apps.
 
Ulf Dittmer
Rancher
Posts: 42969
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
True, but as sam clarified in his 2nd post, the issue is really not code reuse, but inter-app communication.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic