2010-12-17

android: howto put custom .so to /system/lib dir

There are two problems:

1. no permission to write to /system/lib --> chmod /system/lib
2. you cannot chmod /system dir because it is ro file system --> remount it as rw file system

Here are the steps:


1. remount /system with rw

# mount -o remount,rw -t yaffs2 /dev/block/mtdblock3 /system

your devices mounting point can be identified with simple 'mount' cmd at shell.

2. chmod /system/lib

# chmod 6755 /system/lib

3. push your .so to /system/lib

adb push your_custom.so /system/lib

2010-12-16

android: MediaPlayer or VideoView reports -38, 0 error

In my case, it was due to pause the mediaPlayer when it was not playing.

Make sure that object is in expected state. It is always a good habit in programming.

    if (_mediaPlayer.isPlaying() == true) {
        _mediaPlayer.pause();
    }

2010-12-02

android: pause any other media players

The answer is in the VideoView.java src.

Intent i = new Intent("com.android.music.musicservicecommand");
i.putExtra("command", "pause");
context.sendBroadcast(i);
 
On the other hand, if you are developing music/video player of your own, 
you may want to register a broadcast receiver for it as well.