This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
When I open "My Location" button, the app crashes. Here are the logs | |
``` | |
Google Maps Android API I Google Play services package version: 7899438 | |
msg D first lat long : 16.8049667 96.1374455 | |
AndroidRuntime D Shutting down VM | |
E FATAL EXCEPTION: main | |
E Process: org.maepaysoh.maepaysoh, PID: 5192 | |
E java.lang.NullPointerException: Attempt to invoke virtual method 'com.google.gson.JsonArray org.maepaysoh.maepaysohsdk.models.Geometry.getCoordinates( | |
)' on a null object reference |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
String voterName = "အောင်ဆန်းစုကြည်"; | |
String voteDob = "1945-06-19"; | |
Map<String, String> params = new HashMap<>(); | |
params.put("dateofbirth", voteDob); | |
params.put("nrcno", null); | |
params.put("father_name", null); // optional | |
Call<Voter> voterCall = checkVoterService.searchVoter(voterName, params); | |
voterCall.enqueue(new Callback<Voter>() { | |
@Override public void onResponse(Response<Voter> response) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" | |
xmlns:tools="http://schemas.android.com/tools" | |
android:layout_width="match_parent" | |
android:layout_height="match_parent" | |
android:paddingLeft="@dimen/activity_horizontal_margin" | |
android:paddingRight="@dimen/activity_horizontal_margin" | |
android:paddingTop="@dimen/activity_vertical_margin" | |
android:paddingBottom="@dimen/activity_vertical_margin" | |
tools:context="org.mmaug.checkvoterlist.MainActivity"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
String BASE_URL = "https://checkvoterlist.uecmyanmar.org/"; | |
Retrofit retrofit = new Retrofit.Builder() | |
.baseUrl(BASE_URL) | |
.addConverterFactory(GsonConverterFactory.create()) | |
.build(); | |
CheckVoterService checkVoterService = retrofit.create(CheckVoterService.class); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Synchronous in Retrofit 1.9 */ | |
public interface CheckVoterService { | |
@GET("api") | |
Voter searchVoter( | |
@Query("voter_name") String voterName, | |
@QueryMap Map<String, String> optionalQueries | |
); | |
} | |
/* Asynchronous in Retrofit 1.9 */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public interface CheckVoterService { | |
@GET("api") | |
Call<Voter> searchVoter( | |
@Query("voter_name") String voterName, | |
@QueryMap Map<String, String> optionalQueries | |
); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Voter { | |
@SerializedName("dateofbirth") private String dateOfBirth; | |
private String village; | |
@SerializedName("father_name") private String fatherName; | |
private String nrcno; | |
private String state; | |
@SerializedName("voter_name") private String voterName; | |
@SerializedName("dateofbirth_num") private String dateofbirthNum; | |
@SerializedName("mother_name") private String motherName; | |
private String township; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ | |
{ | |
"Name": "ရန္ကုန္အေၿခစုိက္ ပရဟိတ လူငယ္ကြန္ရက္", | |
"Facebook URL": "https://www.facebook.com/YDYVN", | |
"Description": "ေကာလင္းေရေဘးအတြက္ အလႉေငြ သိန္း ၁၂၀ ဖိုးအား အလႉ႐ွင္မ်ား ကိုယ္စား ကြန္ရက္မွ ၃၀.၀၇.၂၀၁၅ မွာ သြားေရာက္လႉဒါန္းပါမည္.......", | |
"Contact Phones": "အိပြင့္ရီွဇံ 09254077923 / ေက်ာ္ၾကား 09254210978 / ျမတ္ၿဖိဳး 09401539798 / တင္ေမာင္ျမင့္ 09972864643", | |
"Donation Location": "" | |
}, | |
{ | |
"Name": "Center for Youth & Social Harmony (လူငယ္ႏွင့္္ လူမွုသဟဇာတၿဖစ္ေၿမာက္ေရးစင္တာ)", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
enum OpCode { | |
OP_TALK, | |
OP_END | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class MainActivity extends AppCompatActivity { | |
@Override protected void onCreate(Bundle savedInstanceState) { | |
super.onCreate(savedInstanceState); | |
ActivityMainBinding binding = DataBindingUtil.setContentView(this, R.layout.activity_main); | |
User user = new User("MeowYLA", "16", "Yangon, Myanmar"); | |
binding.setUser(user); | |
} | |
} |