Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Multiple Packages in an Android App

I am including a class in my app that another developer has made freely available. His class has a different package.

Will this cause any issues on Android, the market, etc? Does every single class in the app need to be my own package?

like image 567
stormin986 Avatar asked May 27 '10 22:05

stormin986


People also ask

Can one Android application have multiple processes?

However, you can arrange for different components in your application to run in separate processes, and you can create additional threads for any process. This document discusses how processes and threads work in an Android application.

Can I upload the same app with different package name?

It is possible to publish app. but different app name,package name and app id in same developer console account in android.

How do I add packages to Android apps?

EDIT: To add a new package to android studio, click on Project -> expand the 'app' directory, expand 'src' -> expand 'main' -> right click on 'java' -> New -> Package.


1 Answers

Despite this being a very old question, I'd like to clarify: Java-level "packages" (which the question is about) and Android .APK "packages" are two different beasts. Java-level "packages" are namespaces to organize classes within your app, whereas the Android "package" name provides a globally unique identifier for your entire app.

Usually at least part of the Java sources in a project is in a Java-level "package" (namespace) matching the Android package name of the app, but that is just for convenience and is not at all required. It is very common to have several Java packages within your app project. Adding to the project 3-rd party Java classes with different namespaces does not affect the name of the resulting Android package. The entire project must have a globally unique Android package name defined in the Manifest, which is later used to identify your app within Google Play.

like image 177
AlexR Avatar answered Sep 20 '22 22:09

AlexR