rebuilt ubuntu NDK environment

sudo echo ‘SUBSYSTEM==”usb”, ATTR{idVendor}==”0bb4″, MODE=”0666″, GROUP=”victor”‘ > /etc/udev/rules.d/51-android.rules

sudo chmod a+ /etc/udev/rules.d/51-android.rules

sudo mkdir -p /usr/local/java
sudo cp ~/Downloads/jdk1.8.0_05/ /usr/local/java/ -fr
mv ~/Downloads/android-ndk-r9d/ ~/dev/ -fr
mv ~/Downloads/adt-bundle-linux-x86_64-20140321/ ~/dev/ -fr

sudo update-alternatives –install “/usr/bin/javaws” “javaws” “/usr/local/java/jdk1.8.0_05/bin/javaws” 1
sudo update-alternatives –set java /usr/local/java/jdk1.8.0_05/bin/java
sudo update-alternatives –set javac /usr/local/java/jdk1.8.0_05/bin/javac
sudo update-alternatives –set javaws /usr/local/java/jdk1.8.0_05/bin/javaws
sudo apt-get install ia32-libs
sudo apt-get install lib32z1  lib32ncurses5 lib32bz2-1.0

sudo apt-get install build-essential
sudo apt-get install lib32z1 lib32z1-dev
sudo apt-get install git byacc libglib2.0-dev parcellite samba subversion

sudo apt-get install git
sudo apt-get install byacc

sudo apt-get install parcellite
sudo apt-get install samba subversion
sudo  ln -s /home/victor/dev/adt-bundle-linux-x86_64-20140321/eclipse/eclipse

Interacting with Java from the Native Side

http://www.math.uni-hamburg.de/doc/java/tutorial/native1.1/implementing/index.html

Call Java class methods

jmethodID mid = (env)->GetMethodID(cls, “callback”, “()V”);
if (mid == 0) {
return (env)->NewStringUTF(buff);
}
(env)->CallVoidMethod(thiz, mid);

 Make a Jclass global reference, lifetime == app life

cls = (*env)->NewGlobalRef(env, cls1);
        if (cls == 0) {
            ... /* error */      
        }

Remember to free the reference when finish DeleteGlobalRef

Android Wear Developer Preview

Thank you for signing up for the Android Wear Developer Preview.

 

To begin developing on Android Wear, you’ll need the Preview Support library and the Android Wear Preview app for your mobile device. Follow these steps:

 

  • Download the Preview Support library and samples.

  • Opt-in to become a tester of the Android Wear Preview app in the Google Play Store. After opt-in, it could take up to 24 hours for the Android Wear Preview app to be accessible to you in Google Play. Make sure the opt-in user account is the same user signed in to Google Play.

 

Refer to the Android Wear Developer Get Started page for details. Since this is a preview release, please do not publicly distribute apps built with the Preview library. Also note that the APIs are potentially subject to change and you will need to modify your apps when they are released out of preview.

 

Share your experiences and ask questions by joining the Android Wear Developers Google+ Community. We look forward to seeing how your apps take advantage of these new APIs to provide innovative new user experiences!

samba-fileserver

https://help.ubuntu.com/10.04/serverguide/samba-fileserver.html

 

sudo apt-get install samba

/etc/samba$ vim smb.conf

[mov]
comment =no use
read only = yes
locking = no
path = /media/xxxxx/1258769F587680F1/mov
guest ok = yes

[G]
comment = no use
read only = yes
locking = no
path = /host
guest ok = yes

sudo restart smbd
sudo restart nmbd

andrio complie unix lib

libnet

libpcap

sudo apt-get install flex

sudo apt-get install -y byacc

<uses-sdk android:minSdkVersion=”9″ />

  • Native Code CPU Architecture Used Compatible Android Platform(s)
    ARM, ARM-NEON Android 1.5 (API Level 3) and higher
    x86 Android 2.3 (API Level 9) and higher
    MIPS Android 2.3 (API Level 9) and higher

    These requirements mean you can use native libraries produced with the NDK in applications that are deployable to ARM-based devices running Android 1.5 or later. If you are deploying native libraries to x86 and MIPS-based devices, your application must target Android 2.3 or later.

  • To ensure compatibility, an application using a native library produced with the NDK must declare a <uses-sdk> element in its manifest file, with an android:minSdkVersion attribute value of “3” or higher. For example:
    <manifest>
      <uses-sdkandroid:minSdkVersion="3"/>
      ...
    </manifest>

 

adb command reference

installation:

apt-get install ia32-libs

apt-get install lib32z1 lib32ncurses5 lib32bz2-1.0

apt-get install build-essential

apt-get install lib32z1 lib32z1-dev

apt-get install lib32stdc++6

usage

lsusb

adb devices -l

abd tcpip 5555

adb connect 192.168.1.100:5555

adb usb

 

enable checkbox events in Listview

listView.setOnItemClickListener(new android.widget.AdapterView.OnItemClickListener() {
public void onItemClick(AdapterView<?> parent, View view,
int position, long id) {
// When clicked, show a toast with the TextView text
Country country = (Country) parent.getItemAtPosition(position);
CheckBox cb=(CheckBox)view.findViewById(R.id.checkBox1);
cb.toggle();
country.setSelected(cb.isChecked());
Toast.makeText(getApplicationContext(),
“Clicked on Row: ” + country.getName(),
Toast.LENGTH_LONG).show();
}
});

 

http://developer.android.com/reference/android/widget/Checkable.html#toggle()

mylib

Want to share Web pages that have content to myself and edit (comment, reorgnize it)

When post a photo, should allow small size photo right to phone size, and allow add comment, links.

Why do peope who want to edit it must register? I can share it with anyone, and they can freely edit it they way they want. but I will keep my version, and I can see other’s version.