Posts by André Ozawa • 477 points
26 posts
-
1
votes1
answer92
viewsA: Convert JSON Java Android - MOIP
Making jsonObject1.getJSONArray("id"); vc is trying to extract an array from this attribute, but in fact it is of the String type. With the new JSONObject(responseStr); you already load the object…
androidanswered André Ozawa 477 -
0
votes1
answer81
viewsA: Autoincremet on Sqlite is not working on Android
Create id column only as _id. Autoincrement is done automatically Something like: db.execSQL("create table usuario(_id integer primary key, nome text not null, email text not null, senha text not…
-
1
votes1
answer291
viewsA: Create listview with database data and put an Edittext in front of each information
After creating your list normally (data and Adapter), just insert them into the dialog. Something like: public class MyDialog extends DialogFragment { @Override public Dialog onCreateDialog(Bundle…
-
0
votes2
answers49
viewsA: Change the color of a list according to a certain variable
Also recover your container layout lista_cronograma. Something like: ConstraintLayout rootCL = (ConstraintLayout) listItem.findViewById(R.id.root_cl); And where you need it, change the background…
-
1
votes2
answers504
viewsA: Query with android sqlite java filter
You should put the filter in the query and then remove the condition if. Something like: Cursor cursor = database.query(BaseDAO.TABELA_AGENDA, BaseDAO.COLUNAS_TABELA_AGENDA, "coluna1 = ? or coluna3…
-
1
votes1
answer235
viewsA: Array elements based on position
@Override public void onListItemClick(ListView l, View v, int position, long id) { super.onListItemClick(l, v, position, id); NoticiasDados noticiasDados = mList.get(position); Intent intent = new…
androidanswered André Ozawa 477 -
0
votes1
answer389
viewsA: Android - org.json.Jsonexception No Value for
ListItem item = new ListItem( o.optString("time"), String.valueOf(o.optLong("milliseconds_since_epoch")), o.optString("date")); …
-
2
votes0
answers65
viewsQ: Check app idle time
What is the most efficient way to check for app idleness? I need to close the app if I haven’t interacted with it in a while. I have a working solution, but maybe there’s something more appropriate…
-
0
votes1
answer227
viewsA: Popular Spinner with firebase data
You can create another or store this list in memory. Creating another one: Also like you did to load the example Bear list, but will set in spinner, spinner.setAdapter(adapter). Pro: online data No…
-
2
votes2
answers369
viewsA: Passing parameter to another Activity with sharedPreference
Retrofit.Builder builder = new Retrofit.Builder() .baseUrl("http://"+getSharedPreferences(PREFS_NAME, Context.MODE_PRIVATE).getString("PrefHost",…
-
0
votes1
answer61
viewsA: Refresh Listview Android with SQL Server
onResume is executed after onStart, that may come after onCreate or onRestart, depends on the state of the activity. I recommend a look at Activity’s life cycle. It would be something like: public…
-
2
votes1
answer273
viewsA: How do I send a JSON object from my android to php?
Roughly it would be something like public class MyAsyncTask extends AsyncTask<String, String, String> { @Override protected String doInBackground(String... params) { URL url = null; try {…
-
2
votes1
answer126
viewsA: How to send Android json object to API?
JSONObject jsonObject = new JSONObject(); jsonObject.put("nome", edtNome.getText().toString()); jsonObject.toString(); //json Tip: If it was on an object (e.g., Addressjava), you could easily use…
androidanswered André Ozawa 477 -
0
votes2
answers380
viewsA: How to assign data from an object to editText on Android?
Create a class. Something like: public class Endereco { private String logradouro; public void setLogradouro(String logradouro) { this.logradouro = logradouro; } public String getLogradouro() {…
androidanswered André Ozawa 477 -
1
votes2
answers293
viewsA: MVC Doubt on Android
Yes, you can use the same controller or dao for as many activities as you need without "weighing it down" (depending of course on how it is done) as in any other platform. As for the callback in…
-
0
votes1
answer52
viewsA: Add and display Indtent in another class
On the next Activity: Intent intent = getIntent(); if(intent != null){ int soma = intent.getIntExtra("pontuação", 0); Log.i("tag", String.valueOf(soma)); } Display soma however you prefer.…
-
0
votes2
answers1220
viewsA: "Expression expected" error
Get your Calendar in updateLabel(Calendar myCalendar) and pass as argument to that same method within the onDateSet.
-
0
votes3
answers278
viewsA: How to find Uri from Gallery on Android 7 nougat
data.getData() Return to the Language Intent.ACTION_OPEN_DOCUMENT
androidanswered André Ozawa 477 -
1
votes2
answers444
viewsA: How to make FAB overwrite items in a Listview
You must use Constraintlayout or Framelayout Something like: <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto"…
androidanswered André Ozawa 477 -
1
votes1
answer246
viewsA: Positioning of Gridlayout Android images
The width your third Imageview is match_parent , so it takes up the entire width of scrollView UPDATE: I adjusted the dimensions, lines and columns. Something like: <ImageView…
-
1
votes1
answer287
viewsA: Add content to a listview (Android)
Keep your Adapter instance and inside onResponse() call the adapter.addAll(servicedata) and notify the controls involved. Something like: public void onResponse(JSONObject response) { JSONArray…
-
1
votes2
answers925
viewsA: Recyclerview does not show data
In your Adapter statement do: public class StoreItemAdapter extends RecyclerView.Adapter<StoreItemAdapter.storeViewHolder> { For your Viewholder to be recognized.…
-
0
votes1
answer75
viewsA: I can’t put hamburger symbol on Navigation Drawer Panel
Keep the instance of DrawerToggle and call the syncState() in onPostCreate @Override protected void onPostCreate(@Nullable Bundle savedInstanceState) { super.onPostCreate(savedInstanceState);…
-
-1
votes1
answer43
viewsA: Webservice for android app without using Tomcat
You could use jboss, wildfly, glassfish. I also recommend the Firebase platform, where it quickly creates a nosql database in the cloud. Course :…
-
1
votes1
answer68
viewsA: Running Java Webservice out of eclipse with Maven
Yes, the. War (jdk-generated package) has all the artifacts referenced in Maven, that is, it would only deploy that package in the server’s Tomcat. I wouldn’t need the Maven on the server.
-
1
votes2
answers769
viewsA: Resize an image before uploading to Firebase
Could use Bitmapfactory: ParcelFileDescriptor parcelFileDescriptor = context.getContentResolver().openFileDescriptor(uri, "r"); FileDescriptor fileDescriptor =…