title: Add one android project as a library in AOSP App
body: <p>I want to add some features into Browser app by start an activity from another android application. It gives me <code>package does not exist</code> while I make the Main Project. Notice that I see the AndroidLib is built successfully into an <code>out/target/product/generic/data/app/AndroidLib.apk</code> </p>
  
  <p>Here are two android.mk files:
  AndroidLib(a normal Android App)</p>
  
  <pre><code>LOCAL_PATH:= $(call my-dir)
  include $(CLEAR_VARS)
  
  LOCAL_STATIC_JAVA_LIBRARIES := \
          google-ps \
          android-support-v4 \
  
  LOCAL_SRC_FILES := \
          $(call all-java-files-under, src) \
  LOCAL_MODULE := AndroidLib
  LOCAL_PACKAGE_NAME := AndroidLib
  
  LOCAL_MODULE_TAGS := tests
  
  LOCAL_PREBUILT_STATIC_JAVA_LIBRARIES := google-ps:libs/google-play-services.jar
  
  include $(BUILD_PACKAGE)
  
  # additionally, build tests in sub-folders in a separate .apk
  include $(call all-makefiles-under,$(LOCAL_PATH))
  </code></pre>
  
  <p>Browser App</p>
  
  <pre><code>LOCAL_PATH:= $(call my-dir)
  include $(CLEAR_VARS)
  
  LOCAL_MODULE_TAGS := optional
  
  LOCAL_STATIC_JAVA_LIBRARIES := \
          android-common \
          guava \
          android-support-v13 \
          android-support-v4 \
  
  LOCAL_SRC_FILES := \
          $(call all-java-files-under, src) \
          src/com/android/browser/EventLogTags.logtags
  
  LOCAL_PACKAGE_NAME := Browser
  
  LOCAL_PROGUARD_FLAG_FILES := proguard.flags
  
  LOCAL_EMMA_COVERAGE_FILTER := *,-com.android.common.*
  
  
  # We need the sound recorder for the Media Capture API.
  LOCAL_REQUIRED_MODULES := SoundRecorder, AndroidLib
  
  include $(BUILD_PACKAGE)
  # additionally, build tests in sub-folders in a separate .apk
  include $(call all-makefiles-under,$(LOCAL_PATH))
  </code></pre>
  
  <p>Then I do:</p>
  
  <pre><code>make -j Browser
  </code></pre>
  
  <p>It gives me: </p>
  
  <pre><code>packages/apps/Browser/src/com/android/browser/BrowserActivity.java:36: package com.om.AndroidLib does not exist
  import com.om.AndroidLib.MainActivity;
  </code></pre>