Wednesday, May 14, 2014

INSTALL_FAILED_VERSION_DOWNGRADE error while trying to reinstall apk ?


Today, I wanted to install a newer version of my app over an existing install.  Even though newer apk version number is higher, it was throwing INSTALL_FAILED_VERSION_DOWNGRADE error.

After looking at the pm command line i came up with this. It worked !

pm install -r -d  test.apk

-r is to reinstall
a- allow version code downgrades



Monday, May 12, 2014

Android LocalServerSocket cannot handle more then 1024 connects/disconnects

For last couple of days I have been trying to fix one serious issue in my app. In Android 4.4.2 a client cannot connect /disconnect to server (created using LocalServerSocket Domain UNIX Socket)  more than 1024 times. How fucked up is that ?

I have uploaded my demo code here http://speedy.sh/NBSjr/SocketIssue.zip

I have posted questions on StackOverflow here http://stackoverflow.com/questions/23559827/emfile-too-many-open-files-error-while-connecting-to-localserversocket

and Google https://code.google.com/p/android/issues/detail?id=69594

Still got nothing!.

After few hours of pulling my hair out, I remembered Jackpal terminal emulator had some code to close the file descriptor. So I decided to take a look there.

https://github.com/jackpal/Android-Terminal-Emulator/blob/master/jni/termExec.cpp

If you pass the client socket file descriptor to his close function. it closes the connection. However it leaves a error on LogCat.

Please let me know if someone found a better solution.



Monday, May 5, 2014

http://androidshell.io

I have been working on http://androidshell.io app and website for quite sometime now. Today I finally managed to get the website, node js server and the android app up and running.

Using androidshell.io you can connect to your Android device from web and execute commands like ps, logcat. I am planing to add more commands in the future.

It has been a long joinery. I have learnt a lot about NodeJS and real-time data processing. I have uploaded NodeJS (Socket.IO) + Android file uploader  code to GitHub.

I was inspired to do this project of because I wanted to make this world better place than when I came in. I hope someone will find it useful.