Working for kawalpemilu for android
On 9 July, Indonesia is doing the biggest democracy event for Indonesian poeple - The Election of Indonesian Presiden (Pemilu in Indonesian). The euforia is so big. Social media is so crowded about news from candidate no 1 Prabowo Subianto - Hatta Rajasa and Joko Widodo - Jusuf Kalla.
As part of this to guard the election Ainun Najib (https://twitter.com/ainunnajib) an ERP Consultant in IBM singapore make a web www.kawalpemilu.org. A lot of attention to this about afraid of cheating make the traffice of the website so high. And as part of that i built the Android version of kawalpemilu.org. The source code is available at https://www.github.com/linggom/kawalpemiluandroid
And how it works ? simple. First i review the source code of www.kawalpemilu.org and look that the website is using kawal-pemilu.appspot.com (Google App Engine) as their host for the API. And start exploring the source code i already figured some API :
host :
www.kawal-pemilu.appspot.com/api/
Api to get the result of election for all District in Indonesia :
www.kawal-pemilu.appspot.com/api/children/{district node}
{district node} is an Id of each province, city, district and subdisctrict Indonesia.
Example of result for execute : www.kawal-pemilu.appspot.com/api/children/0
Based on result i’m start to explore what tools i need to cook the data from the API and translate it to view with user friendly on mobile. The important tool for this project is Retrofit (http://square.github.io/retrofit/) a http rest cient library from square and GSON (https://code.google.com/p/google-gson/) a library to convert JSON data to Java Objects.
To show the data to user, i’m using Tab View Pager so user can swipe to see another district and province
If user want to see detail of province they can press Masuk button
And in the detail of province, they can see total recap of disctrict or result of each district by swiping