How to add App in Android as Basic App

Application Name: PermissionManager

How to add: Following are the steps to add PermissionManager application to Android as basic app.
i.    Copy PermissionManager to /mydroid/packages/apps/ folder.
ii.    Create Android.mk file inside PermissionManager directory.

                    Android.mk    looks like

.                    LOCAL_PATH := $(call my-dir)
.                    include $(CLEAR_VARS)
.                    LOCAL_STATIC_JAVA_LIBRARIES := libarity
.                    LOCAL_SRC_FILES := $(call all-java-files-under, src)
.                    LOCAL_PACKAGE_NAME := PermissionManager
.                    include $(BUILD_PACKAGE)

iii.     Edit /mydroid/build/target/product/generic.mk to add line for   \PermissionManager

                    generic.mk looks like

.                    PRODUCT_PACKAGES := \
.                    AccountAndSyncSettings \
.                    AlarmClock \
.                    PermissionManager \

.                    ……..

.                    ……..
.                    SyncProvider
.                    $(call inherit-product, $(SRC_TARGET_DIR)/product/core.mk)
.                    # Overrides
.                    PRODUCT_BRAND := generic
.                    PRODUCT_DEVICE := generic
.                    PRODUCT_NAME := generic

iv.    Now Compiled source code

v.     After compilation is completed you will see PermissionManager installed.

About these ads

4 responses

  1. Hi. This information was very helpful. If I want to add a java file in framework/base/core/java/android/provider ( something similar to Calendar.java), then how to do that ?

  2. Dear Pinal

    The Post is about adding a complete android application.
    But if you want to add a single java file in framework/base/core/java/android/provider

    Create your java Program JavaFile.java

    
    package android.provider;
    
    public class JavaFile
    {
        public JavaFile ()
        {
        }
    }
    
    

    Go to framework/base/core/java/android/provider and paste JavaFile.java there.

    Make your project,
    JavaFile.java is successfully added.

    1. OK. I did the same way. But let’s consider the Calendar.java file in framework/base/core/java/android/provider. If you have a look at out/target/common/obj/JAVA_LIBRARIES/android_stubs_current_intermediates/src/android/provider, you can see that a Calendar.java file is generated there. If I add my java file framework as per your instructions , I doesn’t generate my file in out/target/common/obj/JAVA_LIBRARIES/android_stubs_current_intermediates/src/android/provider. Although this doesn’t disturb my functionality or code, but I want to know the reason for this.

  3. hello..
    nice tutorial..
    One thing i want to ask is if my app uses location -GPS (that uses Google API and a different emulator) then how do i add/integrate to android source code??

    Thanks .
    Yes

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

%d bloggers like this: