android-source

How does the Android source overlays work?

半城伤御伤魂 提交于 2019-12-05 01:07:31
In the android source in the device/sample folder there is a folder called overlays . You see the same overlay folder in e.g. the cyanogen mods . What is this overlay folder? How does it work? What is it used for? Where can I read more about it? Thanks in advance For instance, imagine that you want to modify some files in Android source for your device (for instance, you want to add additional string to Launcher resources). It is not recommended to modify the actual sources of Android. Instead of this you create overlay that mimics the actual filesystem path layout of Android and put there

Repo Sync a particular folder

自作多情 提交于 2019-12-05 00:58:09
问题 I am trying to get the source code for the android os. How do I repo sync a particular folder from the master branch? 回答1: Partial checkouts are not supported with Git. You could try using git-subtree for, after cloning the all repo, splitting part of that repo into your own project repo. That said, if you are talking about one of the "projects" in the Android, they are Git repos, and can be managed with the tool " repo ". See also "Where can I browse Android source code on-line?" Installing

Making an app in the Android Source compile into system/app instead of data/app?

岁酱吖の 提交于 2019-12-04 21:16:30
问题 I'm compiling an Android ROM from source, and I have several apps that compile, but into data/app on the phone. They're uninstallable through the phone settings. I want them to be impossible to uninstall from the phone, and to compile into system/app instead of data/app. Any advice? edit:typo 回答1: Add: LOCAL_MODULE_PATH := system/app LOCAL_UNINSTALLABLE_MODULE := true LOCAL_CERTIFICATE := platform 回答2: Here is an example of mk file that you can use. In my case the application is then build

iptables forwarding through pptp

落花浮王杯 提交于 2019-12-04 21:00:52
I am creating my own AOSP that contains my own apps and services. One of those services creates ppp0 interface and tries to link specific apps to be forwarded through that interface. I have tried these commands but it was not working as expected. iptables -t mangle -A OUTPUT -m owner --uid-owner 10088 -j MARK --set-mark 100 ip route add via 10.0.0.201 dev ppp0 table 100 ip rule add from all fwmark 100 table 100 iptables -t nat -A POSTROUTING -m owner --uid-owner 10088 -j SNAT --to-source 10.0.0.201 ip route add default dev wlan0 By the way, 10.0.0.201 is ppp0 interface Ip address. This works

What is in android.util.Log#println_native()?

纵然是瞬间 提交于 2019-12-04 19:35:44
Here is the android.util.Log source code. At the very bottom (line 340), what is in the method: public static native int println_native(int bufID, int priority, String tag, String msg); i guess println_native() is more or less like its println() , just with an int bufID different. But even i got the codes of println_native() , i still lack com.android.internal.os.RuntimeInit (line 19, the import ) to simulate android.util.Log in old Android version. Just did some digging in the android source code. This function maps to static jint android_util_Log_println_native(JNIEnv* env, jobject clazz,

CyanogenMod or AOSP: Compile a single project

江枫思渺然 提交于 2019-12-04 19:04:15
问题 I am trying to MAKE / Compile a single AOSP project from the repository - specifically packages/apps/Email. Does anyone know how to do it? (I have no problem compiling the entire repository, but I really would like to be able to compile a single project as well). 回答1: If your environment has been configured by build/envsetup.sh in your android tree, you can run mmm [project_path] to build only a specific subproject. (This will require that you've built its dependencies from the tree before.)

Error android.content.res.Resources$NotFoundException: File from xml type layout resource ID #0x102000a

删除回忆录丶 提交于 2019-12-04 17:35:33
问题 Hey, I'm trying to create a design for a list that looks like (and mostly behaves like) the call log, like shown here: For this I downloaded the source code and I'm studying it for know what class and xml file implement it. And I found this two xml files recent_calls_list_item.xml : <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="?android:attr/listPreferredItemHeight"

android.os.ServiceManager not found while building

我的梦境 提交于 2019-12-04 17:18:07
I am getting following error while building android source, where i have added my custom app which uses android.os.ServiceManager. cannot find symbol symbol : class ServiceManager location: package android.os import android.os.ServiceManager; Why am I facing this error, actually this import can be found in many other app in android source. I am building the android source as in http://source.android.com/source/building.html and also followed this post The import android.os.ServiceManager cannot be resolved answers. and for more info, I am building in [android root]/packages/app/ directory

How Can the Settings App Start an App's Non-Exported Activity?

别等时光非礼了梦想. 提交于 2019-12-04 17:07:35
问题 Android N lets you link an activity of yours into your app's page in Settings. Just add an <intent-filter> for android.intent.action.APPLICATION_PREFERENCES . Android N's Settings app will look for the activity in your app that has that <intent-filter> . If Settings finds one, it will add a gear icon to your app's page in Settings, and if the user taps the gear, they will be taken to your designated activity. I was worried about security, and so I filed an issue, looking for a permission we

Building Android source: error when executing mm?

 ̄綄美尐妖づ 提交于 2019-12-04 16:34:58
Update I got this working. How I am not sure. I did no config changes at all. What I did was: Modify Dialog in frameworks/base/core/java/android/app . Went to my root ( /path/to/source/ ). Then I did mmm frameworks/base/ . Everything worked. Then I tried exactly what I had already tried below: Modify ScrollView (I actually never said which file I was modifying) in frameworks/base/core/java/android/widget . I ch 'ed to frameworks/base/core/java/android/widget . Then I did mm . This time I had no errors like before when the files were removed. Now it just works. Maybe this was some caching or