Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android - sharing activities/code between different applications

Tags:

android

share

I have a single android app with a custom logo, some custom json service endpoints, occasional custom text, and possibly a custom color scheme.

For my client this particular app will need to be rebranded and distributed as an entirely different app about 5-10 times over. So I'm looking for way to reuse the most amount of code - the activities and services will be identical except for the custom things I mentioned.

First off, how can I share projects in the sense that one project will hold all code (including activities), and the others just modify a few values. I can't think of a smart way to share both service code and activity code with the occasional value thrown in via properties.

Do android layout/string resource files have the ability to pull from properties? Can activities be bundled inside a jar and shared with other projects?

like image 245
ant-depalma Avatar asked Jul 30 '12 13:07

ant-depalma


People also ask

Can be used to share data between different applications on Android?

The Android intent resolver is best used when sending data to another app as part of a well-defined task flow. To use the Android intent resolver, create an intent and add extras as you would if you were to call the Android Sharesheet. However, do not call Intent.

How different activities are connected in Android application?

Most apps contain multiple screens, which means they comprise multiple activities. Typically, one activity in an app is specified as the main activity, which is the first screen to appear when the user launches the app. Each activity can then start another activity in order to perform different actions.

How do I open activity from another app?

If both application have the same signature (meaning that both APPS are yours and signed with the same key), you can call your other app activity as follows: Intent LaunchIntent = getActivity(). getPackageManager(). getLaunchIntentForPackage(CALC_PACKAGE_NAME); startActivity(LaunchIntent);

Can an Android app launch another app?

In android, we can lunch other applications using packing name. This example demonstrate about How to Launch an application from another application on Android. Step 1 − Create a new project in Android Studio, go to File ⇒ New Project and fill all required details to create a new project.


1 Answers

You can use Android library project to share the common code. Start by reading this article

like image 166
Dimitar Dimitrov Avatar answered Sep 29 '22 20:09

Dimitar Dimitrov