Tuesday, September 13, 2011

dex2jar Decompile APK file

When I find difficult to do something on Android, I will decompile the APK file and try to learn from the messy java code. But anyway, you may really find something useful that help you out.

Let's see how to decompile. We need some tools to decompile. That is dex2jar. You can find it here. And jd-gui to view the jar as java files.


  1. uncompress the apk. On Windows, use winrar to open the apk and extract.
  2. run command "dex2jar.bat classes.dex", "classes.dex.dex2jar.jar" is generated.
  3. use jd-gui.exe to open jar file and view the java code.

Friday, September 09, 2011

Enable/Renew Team Provisioning Profile:*

There is a Team Provisioning Profile:* in Current Provisioning Profiles in iDP portal.
It's a Wildcard AppID. You don't need to create a AppID and download specified provisioning profile for that AppID. You can use any bundle name and test your app on device with the Team Provisioning Profile:*

Check that whether your certificate is in the certificate list of the Team Provisioning Profile.
If there is not, don't worry. It is managed by Xcode. You can enable it in your Xcode.

Thursday, August 25, 2011

C2DM Implementation Checklist Step by Step

Android C2DM helps your app server push message to your app. It's a mechanism that the server ask the mobile app to fetch new data from server and update itself. C2DM is still in beta version, or Labs version. To use C2DM with your Android applications, you must first signup to request access.

The official doc has a lot of content.
To make it clear, I make the following checklist:


Tuesday, August 23, 2011

C2DM: Get ClientLogin Authentication Token

To send C2DM messages, you should create a new google account as an app-based sender ID and get the ClientLogin Authentication Token.
The most convenient way is using Curl:

curl https://www.google.com/accounts/ClientLogin -d Email=$1 -d Passwd=$2 -d accountType=GOOGLE -d source=companyName-applicationName-versionID -d service=ac2dm

Saturday, July 30, 2011

Android Push Notification Service and C2DM

Apple has support push notification since iOS 3.0
But what about Android??
Android can do this using a long-polling service or keep connected to server.
There are implementations of Android push notification.

1. Cloud to Device Messaging (C2DM) official service by Google
2. AndriodPN at http://sourceforge.net/projects/androidpn/files/
3. Urban Airship Service
4. IBM's MQTT

Thursday, July 21, 2011

_gzwrite _gzclose referenced from - symbol(s) not found

If you are suffering from this build error
just add framework "libz.dylib" to your iPhone project.

It's a "link" error.
For problems like "xxxx reference from ... symbol(s) not found", try to find the missing framework.

Search the link-error method, and "Jump to Definition", you would probably see what framework it is referencing from.

Sunday, July 10, 2011

Info.plist, Failed to launch simulated application: unknown error

I downloaded an opensource iphone project. Failed to build it.

The error message is

could not read data from '/xxxx/xxxx/xxxx/Info.plist': The file “Info.plist” couldn’t be opened because there is no such file.

Wednesday, March 16, 2011

Sharp SH7218U Android folding mobile phone

Recently a new cellphone attracts my eyes.  Sharp SH7218U, really makes a difference. It's the first large-screen/ Android / folding mobile phone I have ever seen.

You can turn the lid clockwise 180 degrees.
Then it becomes a pure touch screen, cell phone. In this mode, here are four virtual Android phone buttons at the bottom of the screen.

Tuesday, March 15, 2011

ASIFormDataRequest Undefined symbols Error, frameworks required

ASIHTTPRequest is a very good open-source project, which help you with complicated http requests.

If you are using  ASIFormDataRequest for the first time. You may find the following error:
Undefined symbols: "_CFHTTPAuthenticationIsValid", referenced from: -[ASIHTTPRequest attemptToApplyProxyCredentialsAndResume] in ASIHTTPRequest.o -[ASIHTTPRequest attemptToApplyCredentialsAndResume] in ASIHTTPRequest.o
..........

How to Migrate SVN Repository to another Server

how to migrate / move a existing subversion (svn) repository to another server?

There are a few easy steps to dump the repository and import into a new server,

1. On your server machine where the repository is now, run
   svnadmin dump REPOS_PATH > mydumpfile

2. Put that file (mydumpfile) on another server.