Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
97 views
in Technique[技术] by (71.8m points)

Differences between Jar, Android Library and Android Library Project

As I understand, the three ways of distributing my application are via Jar, Android Library and Android Library Project.

Jar - cannot contain resources or XML layouts (so this is out for me)

Android Library - I don't really know how this works but the Google API uses it...

Android Library Project - includes resources but allows the client free rein on the code as it is distributed as source.

If I am to create a closed source application that requires drawables and XML files that I want to distribute to other Android programmers, what should I use? And can someone direct me to a tutorial on creating an Android Library?

question from:https://stackoverflow.com/questions/3252552/differences-between-jar-android-library-and-android-library-project

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

More details on what exactly does your project would be welcome. My understanding is that you want to sell a library (a set of components/tools developers can integrate in their app) without disclosing the source.

As you stated, you can't include assets/resources in Jar files.

An Android Library Project would force you to let the source code be "visible". Proper licensing terms could help you put legal fences around source code usage but... well, you know what people do with licenses... Maybe some code obfuscation (not on the public visible methods) could help.

I'm not sure about how "shared libraries" included with <uses-library> work, but the examples have seen are system dependent (maps API available only on "official" Google accepted devices, Sprint Evo front facing camera...) and might require to be built within the system. Maybe some root privilege could help adding one, but this would have to be done on EACH device where applications using your library would want to run...


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...