I developed an app, all of time I used real device(samsung note 5), sometimes used emulator as test device.Today I upload the app to play store. As explained in caption, when I or my friends download the app and run it, it cannot get data from internet and adview is blank. But all of developing time I didnt face this situation. I dont understand.
First photo, real device connected to computer with cable, I run app by Android Studio, apk is sent Android studio to my real device.Close and run it again, close and run it again. Result is the same. Everything is ok.
https://i.stack.imgur.com/CQgOJ.jpg
Second photo, downloaded from play store and run app. All texts and balls are empty.
https://i.stack.imgur.com/7azlc.png
Manifest.xml
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.CLEAR_APP_CACHE" />
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
<uses-permission android:name="android.permission.VIBRATE" />
<uses-permission android:name="com.android.vending.BILLING" />
Spinner Item Selected (No toast mesaage appear in running app)
private AdapterView.OnItemSelectedListener spinnerOnItemSelectedListener = new AdapterView.OnItemSelectedListener() {
@Override
public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
mDrawDateSpinnerPosition = position;
final String drawDate = parent.getItemAtPosition(position).toString();
if (NetworkUtil.getConnectivityStatus(getContext())) {
mProgressDialog = ProgressDialog.show(getContext(), getResources().getString(R.string.please_wait), getResources().getString(R.string.loading), true, false);
new Handler().post(new Runnable() {
@Override
public void run() {
try {
mVolleyUtil.makeRequestForLotto(
getContext(),
Constants.SAYISAL,
DateUtil.formattedDateToNewFormattedDate(drawDate, Constants.DD_MM_YYYY, Constants.YYYY_MM_DD),
createSuccessListener(drawDate),
createErrorListener(drawDate));
} catch (Exception e) {
Log.e("spinnerSelectedListener", e.getMessage());
}
mProgressDialog.dismiss();
}
});
} else {
ToastUtil.show(getContext(), R.string.no_internet_access, Toast.LENGTH_LONG);
}
}
@Override
public void onNothingSelected(AdapterView<?> parent) {
}
};
CreateErrorListener (No toast message appears in running app)
private Response.ErrorListener createErrorListener(final String drawDate) {
return new Response.ErrorListener() {
@Override
public void onErrorResponse(VolleyError error) {
mVolleyUtil.getVolleyController().cancelPendingRequests(this);
mResult = null;
mProgressDialog.dismiss();
if (!NetworkUtil.getConnectivityStatus(getContext())) {
ToastUtil.show(getContext(), R.string.no_internet_access, Toast.LENGTH_LONG);
} else {
ToastUtil.show(getContext(), "Error occured, try again.", Toast.LENGTH_LONG);
}
}
};
}
VolleyRequest
mVolleyController.getRequestQueue().add(
new GsonRequest<>(Request.Method.GET, link + drawDate + ".json",
createErrorListener, LottoDTO.class, createSuccessListener));
Please give me an idea. What is happenning?