Dennis wrote:
> My company is in the process of evaluating if we can add support for
> Android to our product.  I am currently working on porting our
> existing J2ME library to the Android framework and I have a question
> regarding our UI component.  Right now, we have a custom menu that we
> allow our developers to bring up on the device. 

What, exactly, does the menu do?

> On J2ME, we simply
> have a single call that the developer makes to enter into the menu and
> then we handle the rest.
> 
> On Android, it seems the best way to handle this is an Activity.  But
> I have a few questions regarding this approach -- including is the
> really the best way to do something like this?

There are many potential criteria on which to judge "best", and you
haven't really provided enough information here to make any sort of
recommendation.

> Second, if it is, if
> there are multiple applications on the device that are using our
> library, are there going to be conflicts with them all having the same
> Activity embedded in them?

That depends a bit on how you distribute it and how you expect
developers to hook into it.

For example, you can do a literal visual "port" of your current
implementation, as I understand it. You could create a JAR that exposes
a class (MyCoolLibrary) with a static method
(addMyWickedCoolMenuItems()). Developers integrating your JAR could call
that method from onCreateOptionMenu(), passing you the Menu object, and
 you could add in MenuItems as you see fit. Attach Runnables to each
MenuItem, and you'll get control when the user clicks the menu choice.

So long as what you distribute is a JAR that gets "baked into" each app
(as in the above scenario), multiple installed applications will each
have their own local copy of the JAR. If, instead, you create an APK and
expect developers to somehow install your APK with theirs, then multiple
applications might have issues, since there can only be one such copy of
your APK.

> Is it possible to create an Actvity at runtime and use it directly?

No, they need to be registered in an application's AndroidManifest.xml file.

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

Android App Developer Books: http://commonsware.com/books.html

--~--~---------~--~----~------------~-------~--~----~
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