android-source

Extended-width dalvik bytecodes missing on Jellybean

非 Y 不嫁゛ 提交于 2019-12-23 18:46:17
问题 When ICS came out, there were several new extended-width bytecodes introduced. Most of these were for instructions to support jumbo ids. Here are some of these new instructions, taken from my ics/dalvik/opcode-gen/bytecode.txt: # # Extended-width opcodes # op 00ff const-class/jumbo 41c y type-ref continue|throw op 01ff check-cast/jumbo 41c n type-ref continue|throw op 02ff instance-of/jumbo 52c y type-ref continue|throw op 03ff new-instance/jumbo 41c y type-ref continue|throw op 04ff new

Finding Android source code

痴心易碎 提交于 2019-12-23 09:27:47
问题 Are the Android APIs open source? If so, I want to see how they implemented the smoothscroll method for the ListView object (this is implemented in API level 8, but I want to build against an earlier API level). How would I go about finding this? 回答1: This is what you want: ListView source code. 回答2: Yes, it's open source, and http://source.android.com/ has all the information on how to download and browse the source. 来源: https://stackoverflow.com/questions/3673468/finding-android-source-code

Android Source: Is fopen() in bionic libc only used for system internal apps?

断了今生、忘了曾经 提交于 2019-12-23 05:20:52
问题 I created an NDK application that does the following successfully: #include <string.h> #include <stdio.h> #include <android/log.h> JNIEXPORT jstring JNICALL Java_my_package_NativeAccess_stringFromJNI( JNIEnv* env, jobject thiz) { char* str = "Native Code!"; FILE* file = fopen("sdcard/hello.txt","w+"); if (file == NULL) { file = fopen("mnt/sdcard/hello.txt","w+"); if (file == NULL) { file = fopen("storage/sdcard/hello.txt","w+"); } } if (file == NULL) { str = "Native Code! fopen() did not work

Android, NDK, Audio routing, forcing audio through the headset

丶灬走出姿态 提交于 2019-12-23 03:41:26
问题 Use-case Record Android Headset audio Environment Samsung Galaxy 5 Android 5.0 Windows Desktop OS w/ a USB audio capture device Implementation Hook the Android device headset output to the Windows OS Line-In input Record whatever is sent out from the Android Device Problem statement If plugging in the Audio jack while audio is playing on the Android device the device audio output is routed through the headset jack and recording works properly Once audio playback ( for eg. a song ) has stopped

Signing Apk files programmatically in java

☆樱花仙子☆ 提交于 2019-12-23 00:51:24
问题 I need to modify preexisting .apk files present in the /data/app folder. After the modifications the signatures change in the Meta-INF folder. So in order to make sure the apk works properly I need to resign them with the correct md5sum. Is it possible to resign the apks programmatically through java, generating private key and certs through code only? 回答1: I am using Bouncy Castle and this class. Re-sign example: SignedJar bcApk = new SignedJar( new FileOutputStream("out.apk"), signChain,

Porting AOSP to specific hardware device

柔情痞子 提交于 2019-12-22 12:54:20
问题 UPDATE: Based on this Here is following question: Create specific device tree for AOSP I followed this: https://source.android.com/source/building.html and set up the environment and downloaded the latest AOSP. Now I wnat to flash it on my specific device, let's say Galaxy S2. In the "Configuring USB Access: 51-android.rules", how it should look? Because in above official tutorial each entry looks like: //adb protocol for device X SUBSYSTEM=="usb", ATTR{idVendor}=="18d1", ATTR{idProduct}==

Replace only framework.jar & its relevant libraries on Android MarshMallow

六眼飞鱼酱① 提交于 2019-12-22 04:02:03
问题 Anyone know steps to replace frameworks.jar and relevant libraries on Android Marshmallow device? My work is to modify Android Marshmallow framework source code, do full-build then update to device then verify result. It takes about 1,2 hours each time. It is OK if I do it 1,2,3 times but actually I had to repeat it even 100 times if my modification not work. But I only modify only a small piece of code in frameworks/ so I think it would save me much time if I can rebuild only frameworks/

How does the Android source overlays work?

余生颓废 提交于 2019-12-22 02:00:08
问题 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 回答1: 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.

Where is the git repo of Android's kernel source?

依然范特西╮ 提交于 2019-12-21 20:14:51
问题 I want to build a kernel for my device from source, however I'm unable to find the git repo of the kernel source. All I found is this: git://android.git.kernel.org/kernel/common.git But however it seems to be deprecated after the kernel.org fuss recently, with git prompting that fatal: The remote end hung up unexpectedly Are they moving to somewhere or nowhere? 回答1: What was at git://android.git.kernel.org/ can now be found at https://android.googlesource.com/. I did the replacement in your

Disable USB charging

别说谁变了你拦得住时间么 提交于 2019-12-21 18:33:25
问题 For some reasons not related to the battery life, I need to disable the battery charging when a USB host is connected to my phone (a rooted Nexus 4). Taking a look around on the internet (link1, link2), it looks like I should modify a system file. I have found a series of interesting files located in /sys/class/power_supply/battery and /sys/class/power_supply/usb , that could be the right ones to be modified in order to achieve the usb charging disabling (e.g. /sys/class/power_supply/usb