Posts

Showing posts from 2012

Diff

Do a 'git status' in the directory you are concerned with. This will give you the list of files that have changed. Then you can do:  'git diff filename.java > changes.patch' This creates the patch file!

Unable to update Android SDK on Windows?

Some things I had to try to get it to work: Close Eclipse and any other folder that had the android sdk folder opened. Go to /tools Right click on android.bat and select 'Run as Administrator' This should work and you should be able to update the SDK now. If not, well you are screwed...

Logging from native service in Android

To log to a text file from a native daemon process, push the empty file beforehand to /data. Next check that the owner of the process and the location where you are writing are the same.

Busybox on android

This link seems to work http://benno.id.au/blog/2007/11/14/android-busybox Though we have to add busybox to the PATH each time.

Compiling AOSP

Before your images run successfully, y ou need to import the proprietary drivers. So if you want to compile gingerbread and let’s say you need to run it on a Nexus 1, you need to take an original Nexus 1 with gingerbread and import the drivers.  To do this connect the original Nexus One to your build machine and run “ /device/htc/passion/extract-files.sh. If you dont have a device with you, drivers can be downloaded as well. Go to  https://developers.google.com/android/nexus/drivers  and grab the tar files from there. Untar them in the root folder of your android source and run all of them. This should create a vendor folder with the device you need.

Android devices

Taken from  https://sites.google.com/site/androidopenkangproject/downloads-1/downloads  maguro  GSM Galaxy Nexus  toro  LTE Galaxy Nexus  crespo  Nexus S   crespo4g  Nexus S 4G  p4  Galaxy Tab 10.1" - 3G (P7500)  p4vzw  Galaxy Tab 10.1" - Verizon   p4wifi  Galaxy Tab 10.1" - Wi-Fi  stingray  Motorola Xoom - Verizon  wingray  Motorola Xoom - Wi-Fi   tenderloin   HP Touchpad   vivow  HTC Incredible 2  supersonic  HTC Evo 4G  inc  HTC Incredible   vzwtab  Galaxy Tab 7" - Verizon In addition Nexus 7 is called grouper Now these were the devices. Next we have boards. These board names are used when we compile the kernel using the _defconfig command. You can retrieve them by going into the bootloader of your phone Nexus One:       Mahimahi Nexus S    : ...

Perl Regexp

Great link: http://mailman.linuxchix.org/pipermail/courses/2003-August/001305.html

Virtual Box Shared Folder

Just restart the Vm after making the changes and it should work http://www.howtogeek.com/75705/access-shared-folders-in-a-virtualbox-ubuntu-11.04-virtual-machine/

Good Android Links

http://www.vogella.com/articles/AndroidListView/article.html#listsactivity_simpleadapter

endmenu in different file than menu?

So I was adding my driver to the Linux kernel. Made a new Kconfig file and added 'menu' and 'endmenu' sections. But when I compiled the kernel I got an error saying 'endmenu in different file than menu'. Reason: There has to be a new line character after endmenu in your Kconfig file!

A binary with debug symbols with the Android NDK

First go into the Android.mk file in your jni folder and add this line: LOCAL_CFLAGS  += -g This is going to enable the debug compile option. You might have a separate option for logging more data. Next go into Application.mk and uncomment this line: APP_OPTIM := debug (or add it if it isnt there) This should be sufficient. Now when you run the ndk-build (You can run ndk-build V=1 to enable the verbose option), you should get the debuggable binaries. For some reason the binary I get in the libs/armeabi folder is not the debuggable one, this one has its debug options stripped out. To get the debug one grab it from obj/local/armeabi.

Sun JDK on Ubuntu

Thought it would be simple, but apparently not. These are the instructions I followed first and the installer seemed to get stuck at 99% for some reason: sudo add-apt-repository "deb http://archive.canonical.com/ lucid partner" sudo apt-get update sudo apt-get install sun-java6-jdk To get it to work, replaced the last 2 lines by: sudo apt-get install sun-java6-jre sun-java6-plugin sudo update-alternatives --config java

Comparing directrories using diff

diff -qr --exclude=".svn" --exclude=".git" --exclude="STATIC_LIBRARIES" dir1 dir2 q is for brief, which means output only if the files differ r is for recursive since we are comparing directories. we exclude certain directories using the exclude option

Dynamically allocating 2d arrays in C++

http://www.codeproject.com/KB/cpp/arrayDinamic.aspx

Debugging an android crash

Image
So lets say one of your android app crashes and you get something like this in your logcat: Here #00 tells us the address in the program counter. But this information is pretty useless. To translate into actual file and line numbers we can use a tool called addr2line. For NDK4 it is located at android-ndk-r4b/build/prebuilt/linux-x86/arm-eabi-4.4.0/bin. For NDK5 it is at a different location. So we go to this location and run the tool: addr2line -f -e mydroid/gingerbread_2.3.3_GINGERBREAD/modified/out/target/product/crespo/symbols/system/lib/libmedia.so 0004853a This gives us the file and line numbers we are looking for. We use the code in the symbols directory because that has the unstripped version of the libraries.