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

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>

Internal Mem Opt Zone 3

Im having memory issues. I can generally free up 2gig of Internal mem by clearing out the cache and browser cache.

In the last week however. With the caches emptied I cannot get above 1.3 free. So whats up with the 700meg I cant find. Any suggestions. Is there another area in the phone thats a memory hog that I can delete temp files that are taking up space.

dissapearing albums and photos

Well at least the images are still there :)

I've not used the Samsung app, but I guess the "albums" are internal to that app (as they are in most Gallery apps: I have virtual albums in Photos and F-Stop, but neither knows about the other and no photos are moved, these are just how the individual apps present them). So I can only guess that the update changed the Samsung Gallery app and it lost some of its internal settings.

OUTLOOK DARK MODE

hmmmm found this:
https://www.xda-developers.com/microsoft-outlook-dark-mode-android-leak/

it was leaked in july and now officially on microsfts blog:
https://medium.com/microsoft-design/designing-dark-mode-31400530787a

so that article is from a few days ago on Aug 28th......so it looks like it might be a while for it to be officially released. i did not see an official date for rollout for dark mode.

.....looks very cool though

Black screen with boot animation stuck

well just my opinion....i never rooted a device unless it has a custom recovery. it is your life line, from a bricked device, to a working one.

rom manager apps are also something i would never recommend either. they tend to screw things up more time then not.

not being familiar with your device you might want to see if there is a firmware for your specific device to flash. this might unroot you or lock your bootloader, but at least you will have a working device.

if there is no firmware for you to flash then i'm not quite sure what you can do.

How to enable dark mode in Motorola G5s Plus

Bro the article is regarding enabling dark mode in Android Pie and not Android Oreo.
ooops could have sworn it said oreo.....sorry
If I'm not mistaken, dark mode is only for android 9 pie and up.
you are right now that i think of it.

edit: it was way too early for me when i found the link......probably was not fully awake....LOL

Note 10 Plus

When I set the Do Not Disturb I only want the alarms to sound off only problem is they do not, no sound and no visual display, only a push pin icon on the lock screen.

I do have alarms turned on in the settings and have them listed as exceptions also. My Note 5 Never did this. What's going on?
did you make sure to allow alarms to sound off?

settings>notifications>do not disturb>allow exceptions>alarms

Creating custom ROM

Hello Eric,

Thank you for your reply. This is my first time working with the Android source. I apologize if my questions seem noob-ish

1) What is the purpose for creating a mirror? I downloaded the source per Google's instructions. I wanted to download the latest version of the source so I didn't specify a branch.

2) What is the client in the context of your description?

3) The link for the local_manifests git that you posted, can I use the same file for builds higher then Android 6?

4) I think that you forgot to post the kernal source. But, if I am compiling Android directly, then is this really needed?

1. Mirror is for just in case the main link site goes down for whatever reason. You HAVE to specify the branch desired or you'll just get the root branch.. Nothing will really build with that.
2. I'm unsure about clients, I'm not aware of ever using them yet..
3. No. Each branch has its own manifest..
4. Yes, you need it but is usually downloaded via the "lineage.dependencies.mk" (makes roomservice.mk during 1st build attempt) or "roomservice.mk" or "local_manifest.mk" for that SPECIFIC device..

Roku TV

You can only get your local channels by using an antenna, which has nothing to do with using a Roku, OR by signing up with a streaming service that has local channels in their plans.
...or by getting basic cable, or by getting DirecTV, but then we're talking paying for it (plus having lots of channels to watch).

Any relatively modern TV should have the built-in ability to scan for local channels, which are all digital now. But an external antenna may be necessary if you're in an area that doesn't get strong signals.

Use the TV's remote and menu, and find its 'scan for channels' feature. Then decide if an antenna is needed.

Filter

Back
Top Bottom