Mark Murphy wrote:
> Shachar Shemesh wrote:
>   
>> I have created a custom View class. I would now like to be able to
>> create instances for it from other applications, so that they will use
>> it as if it's one of the built in classes. In other words, I want to
>> create the dalvik equivalent of a shared object. I want other
>> applications to be able to write "import my.domain.and.class.name;". If
>> I can even make them write it in the Layout resource file, even better.
>>
>> What is the best way to go about doing it?
>>     
>
> Step #1: Set up a separate project for your reusable component, perhaps
> with a sample or demo application.
>
> Step #2: Create an API for your reusable component that accepts all
> resources as parameters, since resources are tied to the APK.
>
> Step #3: Create an Ant task, Eclipse...ummm...thingamajig, or shell
> script/batch file to create a JAR file with just your compiled classes.
>
> Step #4: Distribute the JAR file, or upload the whole thing to github.
>
>   
Totally confused.

I actually came across the "PlatformLibrary" sample and readme, as well 
as a lot of googling while waiting for the moderator to approve my first 
email to the list. I came up with "you need to place the JAR with a 
classes.dex in /system/framework and /etc/permissions" solution, which 
pretty much requires you to compile inside the android source tree. Now 
you are telling me I need to compile it completely outside the source 
tree. Like I said - confused.

Once the JAR is created, how do I link an application with it? How do I 
make sure it has access to the code during run time? A regular JAR has 
.class files, which need translation before they can run on Dalvik.
> You can take a look at some of my CWAC components for examples of this
> process:
>
> https://github.com/commonsguy
>
>   
Thanks,
Shachar

-- 
Shachar Shemesh
Lingnu Open Source Consulting Ltd.
http://www.lingnu.com


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Beginners" 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-beginners?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to