Tuesday, November 09, 2010

Can’t establish a reliable data connection to the server (solved)

If your Android device says "Can’t establish a reliable data connection to the server" when you about to connect to Google Account, you may check the date and time setting.
Please set the correct date, time and time-zone manually. Your network may not be able to provide the correct date & time.

To do this, on you home screen, click "menu" button, click "setting" menu item, scroll down until you find the "Date and time" menu and click it.
And back to your GMail/Market/Account setting.

At least this method works on my Galaxy S.

Saturday, October 09, 2010

Connecting your Android device to Ubuntu

+ Download and install Android SDK for linux
+ Connect your Android device to your Ubuntu box, set to Debug mode on your device
+ Open your terminal at Ubuntu
+ Run "lsusb"
+ Look for your device. For my device is "Bus 001 Device 011: ID 22b8:41db Motorola PCS " . Take note on the ID XXXX:YYYY .
idVendor  : XXXX
idProduct :  YYYY

+ Create file /etc/udev/rules.d/51-android.rules
+ Write down one line :
    SUBSYSTEM=="usb", ATTRS{idVendor}=="22b8", MODE="0666"

or just copy these line  (hope your device listed here) :
SUBSYSTEM=="usb", ATTRS{idVendor}=="0bb4", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="0e79", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="0502", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="0b05", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="413c", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="0489", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="091e", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="18d1", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="0bb4", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="12d1", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="24e3", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="2116", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="0482", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="17ef", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="1004", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="22b8", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="0409", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="2080", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="0955", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="2257", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="10a9", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="1d4d", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="0471", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="04da", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="05c6", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="1f53", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="04e8", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="04dd", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="0fce", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="0930", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="19d2", MODE="0666"

+ sudo chmod a+r /etc/udev/rules.d/51-android.rules
+ sudo chown root. /etc/udev/rules.d/51-android.rules
+ sudo service udev restart
+ sudo killall adb

+ Go to "tools" folder on your Android SDK
   - cd /mypath/android-sdk-linux_86/tools
   - ./adb devices
Look for your device in the output,

List of devices attached
04037A281900D01A    device

That's it. Have fun ...

Wednesday, July 21, 2010

To switch back to the default app on android

I keep forgetting how to switch back to the default app after (accidentally)  set the default app to 3rd party app on android.

You need to go to Home screen > Settings > Applications > Manage applications > (3rd app name)  > Launch by default > Clear defaults.

Monday, May 10, 2010

Your Android target is missing when you create a new Android project on Eclipse

If your Android target is missing when you create a new Android project on Eclipse then try to change your screen resolution to at least 1024 x 768.
I try to create a new Android project with Eclipse on my netbook which the screen resolution is 1024 x 600 . I can not select the target due to there is no target listed. Then change the screen resolution to make it appeared.

Set 3G Network Only for Android

UPDATED : On Froyo / Gingerbread you can select the network via "Setting" > "Wireless and Network" > "Mobile Networks"  > "Network Mode" .

Annoyed by network auto selected to EDGE where 3G is available.
To set your Android mobile phone to use 3G Only network you need to install an app from Market.
Make sure you have a room in Home screen for one short cut icon.
Search for "Any Cut" and install it.
Run "Any Cut", add a short cut.
Select "Activity", wait for activity list.
Select "Phone info".

"Phone info" short cut should be appeared.
Run "Phone info".
Set the preferred network type : "WCDMA only"

That's it. Enjoy your 3G (if available).

Sunday, April 18, 2010

WSGI and mod_python

Some how WSGI and/or mod_python develop memory leak.
If you seen your memory & swap space all taken up by Apache that load WSGI and / or mod_python you might try this work around :

Set MaxRequestsPerChild in apache2 conf to some number instead of 0 (zero).
In my case I set MaxRequestsPerChild to 3 due to the Apache is quite fast to take the memory.

Search for all MaxRequestsPerChild directives, you might be found it at multiple places.

Update : Please read the comment from the creator of mod_wsgi below .