[Solved] Why getting errors in android studio when adding code to the main activity xml? [closed]

You may need to take a course on Java in general before you start jumping into Android which far more complex. Every argument for requestPermissions is not valid Java activity: this is not valid Java. Just use this. string[]{Manifest.permission.RECORD_AUDIO} is not valid Java. Change it to this new String[]{Manifest.permission.RECORD_AUDIO} requestCode.1 is not valid Java just … Read more

[Solved] How to show background bitmap on 2D

When looking at the uv-coordinates and the vertex coordinates, one can see that they do not fit together: vertex ———————————————- 0.0f,0.0f,-1.0f, 0.0f, 0.0f, with,0.0f,-1.0f, 0.0f, 1.0f, <– vertex: change in x, uv: change in y with,heigh,-1.0f, 1.0f, 1.0f, 0.0f,heigh,-1.0f 1.0f, 0.0f In addition, you tell OpenGL in this line: GLES20.glVertexAttribPointer(mTextureCoordinateHandle, 3, GLES20.GL_FLOAT, false, 0, uvBuffer); … Read more

[Solved] High Score in Android [closed]

Like Tobiel said if your data is stored in your database a query will be much better. However, if you need to do it in code you should modify your Collection sort. If in your scoreList you have a collection of Score objects you can compare their scores like this: Collections.sort(scoreList, new Comparator<Score>() { @Override … Read more

[Solved] having real trouble in this app ; [duplicate]

mShowAnswers.setText( marksObtained ); This line contains the bug. As you are setting text into the textview(mShowAnswers) and the marksObtained is integer value, what is happening is Android is taking this marksObtained integer value as @StringRes and is trying to get matching String Value from Strings.xml which is not found and hence the exception is shown. … Read more

[Solved] how i change my keypad for type mail-id?

You can use input type as: <EditText android:layout_width=”match_parent” android:layout_height=”wrap_content” android:hint=”@string/email” android:inputType=”textEmailAddress” /> 0 solved how i change my keypad for type mail-id?

[Solved] How to make mobile apps for different OS [closed]

To make apps (mobile apps, I think you mean) for different OS’s(I think you mean the different OS’s on each phone),(assumption: that you’re coding it from scratch) you learn a programming language first, then proceed to learn how to make apps for a particular OS. Typically, you purchase a book (look online for good recommendations) … Read more

[Solved] java.lang.NullPointerException while fetching value from EditText [duplicate]

You can’t just instantiate your Activity and access the TextView members on it. This doesn’t make any sense: indoor_patient ins=new indoor_patient(); String webUrl = “http://10.0.3.2:8084/data_web/indoorPatient.jsp?sr_no=” + ins.sr_no.getText().toString() Instead you could figure out what your webUrl is in your onClick() method and pass in the complete URL as a parameter to the AsyncTask: submit.setOnClickListener(new View.OnClickListener() { … Read more

[Solved] Cannot run the code sample

Try to set “app” or similar on here: UPDATE1 (Maybe it’s the problem) That project it’s not a new gradle project then maybe you imported wrong, you must import the project as “Import project (Eclipse ADT, Gradle…)” 4 solved Cannot run the code sample

[Solved] Java gives me wrong time every time i try to get it [closed]

This answer has some of the time zones to use in your getTimeZone method. Calendar curTime = new GregorianCalendar(); curTime.setTimeZone(TimeZone.getTimeZone(“Europe/Kiev”)); DateFormat dateFormat = new SimpleDateFormat(“HH:mm”); dateFormat.setCalendar(curTime); String time = dateFormat.format(curTime.getTime()); System.out.println(time); Output: 19:22 1 solved Java gives me wrong time every time i try to get it [closed]

[Solved] Make array of variables?

you can ad an arrayList of integers, strings, or paracelables as an extra for an intent from the first activity Intent i = new Intent(context,SecondActivity.class); i.putIntegerArrayListExtra(name, value); i.putStringArrayListExtra(name, value); i.putParcelableArrayListExtra(name, value); in the second Activity onCreate() Intent i = getIntent(); ArrayList<String> myStrings = i.getStringArrayListExtra(name); 4 solved Make array of variables?

[Solved] Android-RESTful Services

There a number of REST libraries that do more or less for you. Arguably, the most popular for Android are Retrofit (https://github.com/square/retrofit) and my personal favourite RoboSpice (https://github.com/stephanenicolas/robospice) for two simple reasons: runs as a service and works alongside Activity lifecycle. Answering which one is the best would start a flame war. Keep in mind … Read more

[Solved] Creating id for Android Views

if it is right to reference the TextView in both the XML files with same id? It is totally fine, the compiler will only look at the ID under a single view hierarchy. e.g.: findViewById(R.id.textview) inside ActivityA.java will only search for textview ID inside activity_a.xml (assuming you have setContentView(R.layout.activity_a); beforehand. what is the recommended way … Read more