• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Help Unsure what this issue is called

Yeah its pretty random but still annoying. I was noticing its when I'm accidentally scrolling on something or don't realize it when I go to tap a link or something. Even in Camera mode, if my thumb rubs the edge it thinks I'm trying to zoom.. then the button to snapshot refuses to work.

I just got the note 10 so no case, but I will try that and see if it helps. Thanks for the replies!

Layout File Storage

I started a new app for a classroom tutorial video from Udemy.com on Android Studio. Now when I bring the app back and I have put a button, three editText boxes and three TextView boxes onto the layout, I can't bring the layout back and I can't find the layout file anywhere on my computer (at least so far). My question is: Does the layout file automatically save itself with Android Studio? With B4A android language's IDE, the layout file must be named and saved. I saw no prompt that I had to save or name the layout for my app ("Registration Form". Here's the app's Activity_main.xml code.
Code:
<?xml version="1.0" encoding="utf-8"?>

<resources xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent">
    <item name="workouttype" type="id" />
    <item name="txthello" type="id"/>
</resources>

<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context=".MainActivity">

    <EditText
        android:id="@+id/editTextFirstName"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginTop="100dp"
        android:ems="10"
        android:inputType="textPersonName"
        android:text="First Name"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toTopOf="parent" />

    <EditText
        android:id="@+id/editTextLastName"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginTop="24dp"
        android:ems="10"
        android:inputType="textPersonName"
        android:text="Last Name"
        app:layout_constraintStart_toStartOf="@+id/editTextFirstName"
        app:layout_constraintTop_toBottomOf="@+id/editTextFirstName" />

    <EditText
        android:id="@+id/editTextEmail"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginTop="24dp"
        android:ems="10"
        android:inputType="textPersonName"
        android:text="Email"
        app:layout_constraintEnd_toEndOf="@+id/editTextLastName"
        app:layout_constraintStart_toStartOf="@+id/editTextLastName"
        app:layout_constraintTop_toBottomOf="@+id/editTextLastName" />

    <Button
        android:id="@+id/btnRegister"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginTop="100dp"
        android:text="Register"
        app:layout_constraintEnd_toEndOf="@+id/editTextEmail"
        app:layout_constraintStart_toStartOf="@+id/editTextEmail"
        app:layout_constraintTop_toBottomOf="@+id/editTextEmail" />

    <TextView
        android:id="@+id/textViewFirstName"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginTop="100dp"
        android:text="First Name"
        app:layout_constraintEnd_toEndOf="@+id/btnRegister"
        app:layout_constraintStart_toStartOf="@+id/btnRegister"
        app:layout_constraintTop_toBottomOf="@+id/btnRegister" />

    <TextView
        android:id="@+id/textViewLastName"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginTop="24dp"
        android:text="Last Name"
        app:layout_constraintEnd_toEndOf="@+id/textViewFirstName"
        app:layout_constraintHorizontal_bias="1.0"
        app:layout_constraintStart_toStartOf="@+id/textViewFirstName"
        app:layout_constraintTop_toBottomOf="@+id/textViewFirstName" />

    <TextView
        android:id="@+id/textViewEmail"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginTop="24dp"
        android:text="Email"
        app:layout_constraintEnd_toEndOf="@+id/textViewLastName"
        app:layout_constraintStart_toStartOf="@+id/textViewLastName"
        app:layout_constraintTop_toBottomOf="@+id/textViewLastName" />
</androidx.constraintlayout.widget.ConstraintLayout>

Music player apps not reading SD card

Hi, I have a Nokia 3.1 running Android 9. I have a problem which seemed to start after a recent update...
I have a 128gb SD card with about 45gb of music on it.
Most music player apps don't seem able to read the card properly (the only ones that can read it have really bad user interfaces and limited functions)
Some music player apps can read a few tracks (91 seems to be a common number, I don't know why), others cannot read any.
I know that the card is readble, because the file explorer app can read it and display all the files.
Can anyone help me with this please?
Thanks!

Just out of curiosity, what file format are your music files? (ie. wav or mp3 etc)

Are the 91 files a different file format from the rest?

I ask these questions because it can be a file format that the music players are having trouble with. If you don't mind, please try VLC media player which can play all file types, even the most obscure. It's both a video and audio player...
https://play.google.com/store/apps/details?id=org.videolan.vlc&hl=en_US

Panda Wish Launch

We are honored to announce the launch of our mobile app Panda Wish (first on demand massage app in the Philippines).

Our app still early on and currently offer it's service in one region in the Philippines (Bicol Region). We looking forward to take it further.

Appreciate sharing your feedback and thoughts on the app.

Thank you

No nightmode on my s9 plus

&gt; 'Do you like the s9 plus'

Yes, it's a great phone. Snappy, with some good features added by Samsung.

My only complaint is that my battery life seems to be dropping lately, without any obvious culprit. I'm afraid my heavy use for the past 15 months may be degrading it. I guess I'll have to get used to carrying around a power pack.

I find if you have display on drains battery too so I turned that off

Help help with alarm clock ringtone

1st this is on a Alcatel One Touch Fierce 7 phone, model 6062W. I have a saved ringtones on the SD card in the phone but I don't know where to find the dir's for the alarm clock ringtone and the phone's ringtone, when someone calls me. Also I heard about an app that can be prog to say the persons name when the phone rings with that persons number. Is there such an animal?

Steve

I want android tv box to stop usb while in sleep mode

hey guys i have android tv box a95x f1 and I have a little usb fan running under it, but i want the fan to only run when being used, i managed to get it to shut down after a certain period of time but even while it's completely powered off the fan still runs, but before if I manually turned it off the fan would stop, now it doesn't matter how I turn it off the fan keeps running

Post and Brag Up Your Pics Place

I thought so! He's a good looking dog. We have an American Bully (Tiana) and when I saw Bailey I thought of her. Good looking dog! :)
thanx. we go on adventures together all of the time. i used to love summers, but here in LA the weather is to hot for us to do anything really unless it is in the morning or evening. imight go out on hike that has some tree coverage tomorrow evening. i'm curious to see how well the phone does under low light conditions......i'll post pics tomorrow evening possibly.

Can I have a group of tabs when I open Chrome?

Like you can on PC, I'd like to have a few of my favorite sites accessible on tabs when I open chrome.
Yes it's possible. Just open chrome and click on the number that is in a square at the top right and then click the + sign at the top left for a new tab.

If you'd like all the tabs to open every time you open chrome then when you close chrome, do it with the home button. This way when you open it again it will open all your tabs.

Webview; Camera not responding

Creating simple webview where camera is used. All camera works outside of webview. Just looking for some direction here - my eyes are bleeding after a few hours at looking at this. Event log shows no errors and gradle build finishes in 3s. Logcat only shows a memtrack error "couldn't load memtrack module" - which I believe is related to type emulator used.

Looking for some insight

My activity xml
<?xml version="1.0" encoding="utf-8"?>
<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"

tools:context="com.app.cameratest_java.MainActivity">

<WebView
android:id="@+id/webview"
android:layout_width="match_parent"
android:layout_height="match_parent" />

</RelativeLayout>

MainActivity java
package com.app.cameratest_java;

import android.Manifest;
import android.app.Activity;
import android.app.AlertDialog;
import android.content.pm.PackageManager;
import android.os.Build;
import android.os.Bundle;
import android.util.Log;
import android.webkit.PermissionRequest;
import android.webkit.WebChromeClient;
import android.webkit.WebSettings;
import android.webkit.WebView;
import android.webkit.WebViewClient;
import androidx.appcompat.app.AppCompatActivity;
import androidx.core.app.ActivityCompat;
import androidx.core.content.ContextCompat;
import java.util.ArrayList;
import java.util.List;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.SharedPreferences;
import android.net.Uri;
import android.provider.Settings;

public class MainActivity extends AppCompatActivity {
private WebView webView;
private static final String TAG;

static {
TAG = "MainActivity";
}
public static final int MY_PERMISSIONS_REQUEST_CAMERA = 100;
public static final String ALLOW_KEY = "ALLOWED";
public static final String CAMERA_PREF = "camera_pref";


@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);

if (ContextCompat.checkSelfPermission(this, Manifest.permission.CAMERA) != PackageManager.PERMISSION_GRANTED) {
if (getFromPref(this, ALLOW_KEY)) {
showSettingsAlert();
} else if (ContextCompat.checkSelfPermission(this,
Manifest.permission.CAMERA)

!= PackageManager.PERMISSION_GRANTED) {

// Should we show an explanation?
if (ActivityCompat.shouldShowRequestPermissionRationale(this,
Manifest.permission.CAMERA)) {
showAlert();
} else {
// No explanation needed, we can request the permission.
ActivityCompat.requestPermissions(this,
new String[]{Manifest.permission.CAMERA},
MY_PERMISSIONS_REQUEST_CAMERA);
}
}
} else {
openCamera();
}
webView = (WebView) findViewById(R.id.webview);
webView.setWebViewClient(new WebViewClient());

webView.loadUrl("https://yadayada_html?appid=e780e85949a2499a9acd3236a756344e");

WebSettings webSettings = webView.getSettings();
webSettings.setJavaScriptEnabled(true);


webView.setWebChromeClient(new WebChromeClient() {

@Override
public void onPermissionRequest(PermissionRequest request) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
request.grant(request.getResources());

if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
int hasCameraPermission = checkSelfPermission(Manifest.permission.CAMERA);
Log.d(TAG, "has camera permission: " + hasCameraPermission);
int hasRecordPermission = checkSelfPermission(Manifest.permission.RECORD_AUDIO);
Log.d(TAG, "has record permission: " + hasRecordPermission);
int hasAudioPermission = checkSelfPermission(Manifest.permission.MODIFY_AUDIO_SETTINGS);
Log.d(TAG, "has audio permission: " + hasAudioPermission);
List<String> permissions = new ArrayList<>();
if (hasCameraPermission != PackageManager.PERMISSION_GRANTED) {
permissions.add(Manifest.permission.CAMERA);
}
if (!permissions.isEmpty()) {
requestPermissions(permissions.toArray(new String[permissions.size()]),111);

}
}
}
}
});
}

public static void saveToPreferences(Context context, String key, Boolean allowed) {
SharedPreferences myPrefs = context.getSharedPreferences(CAMERA_PREF,
Context.MODE_PRIVATE);
SharedPreferences.Editor prefsEditor = myPrefs.edit();
prefsEditor.putBoolean(key, allowed);
prefsEditor.commit();
}

public static Boolean getFromPref(Context context, String key) {
SharedPreferences myPrefs = context.getSharedPreferences(CAMERA_PREF,
Context.MODE_PRIVATE);
return (myPrefs.getBoolean(key, false));
}

private void showAlert() {
AlertDialog alertDialog = new AlertDialog.Builder(MainActivity.this).create();
alertDialog.setTitle("Alert");
alertDialog.setMessage("App needs to access the Camera.");

alertDialog.setButton(AlertDialog.BUTTON_NEGATIVE, "DONT ALLOW",
new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
dialog.dismiss();
finish();
}
});

alertDialog.setButton(AlertDialog.BUTTON_POSITIVE, "ALLOW",
new DialogInterface.OnClickListener() {

public void onClick(DialogInterface dialog, int which) {
dialog.dismiss();
ActivityCompat.requestPermissions(MainActivity.this,
new String[]{Manifest.permission.CAMERA},
MY_PERMISSIONS_REQUEST_CAMERA);
}
});
alertDialog.show();
}

private void showSettingsAlert() {
AlertDialog alertDialog = new AlertDialog.Builder(MainActivity.this).create();
alertDialog.setTitle("Alert");
alertDialog.setMessage("App needs to access the Camera.");

alertDialog.setButton(AlertDialog.BUTTON_NEGATIVE, "DONT ALLOW",
new DialogInterface.OnClickListener() {

public void onClick(DialogInterface dialog, int which) {
dialog.dismiss();
//finish();
}
});

alertDialog.setButton(AlertDialog.BUTTON_POSITIVE, "SETTINGS",
new DialogInterface.OnClickListener() {

public void onClick(DialogInterface dialog, int which) {
dialog.dismiss();
startInstalledAppDetailsActivity(MainActivity.this);
}
});

alertDialog.show();
}

@Override
public void onRequestPermissionsResult(int requestCode, String permissions[], int[] grantResults) {
switch (requestCode) {
case MY_PERMISSIONS_REQUEST_CAMERA: {
for (int i = 0, len = permissions.length; i < len; i++) {
String permission = permissions;

if (grantResults == PackageManager.PERMISSION_DENIED) {
boolean
showRationale =
ActivityCompat.shouldShowRequestPermissionRationale(
this, permission);

if (showRationale) {
showAlert();
} else if (!showRationale) {
// user denied flagging NEVER ASK AGAIN
// you can either enable some fall back,
// disable features of your app
// or open another dialog explaining
// again the permission and directing to
// the app setting
saveToPreferences(MainActivity.this, ALLOW_KEY, true);
}
}
}
}

// other 'case' lines to check for other
// permissions this app might request
}
}

@Override
protected void onResume() {
super.onResume();
}

public static void startInstalledAppDetailsActivity(final Activity context) {
if (context == null) {
return;
}

final Intent i = new Intent();
i.setAction(Settings.ACTION_APPLICATION_DETAILS_SETTINGS);
i.addCategory(Intent.CATEGORY_DEFAULT);
i.setData(Uri.parse("package:" + context.getPackageName()));
i.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
i.addFlags(Intent.FLAG_ACTIVITY_NO_HISTORY);
i.addFlags(Intent.FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS);
context.startActivity(i);
}

private void openCamera() {
Intent intent = new Intent("android.media.action.IMAGE_CAPTURE");
startActivity(intent);
}



@Override
public void onBackPressed(){
if (webView.canGoBack()) {
webView.goBack();
} else {
super.onBackPressed();
}
}
}


Manifest xml

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.app.cameratest_java">

<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.CAMERA"/>
<uses-feature android:name="android.hardware.camera" />
<uses-feature android:name="android.permission.LOCATION_HARDWARE"/>
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
<uses-permission android:name="android.permission.ACCESS_BACKGROUND_LOCATION"/>


<application
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/AppTheme">
<activity android:name=".MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />

<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>

</manifest>

Filter

Back
Top Bottom