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

Butterfly Watch Face

Just released: Butterfly Watch Face

With free & premium features : more than 50 backgrounds, custom colors, 8 datas & infinite data with complications.
Secondary timezone, a lot of possibilities for ambient mode, and many other features to discover!

I hope that you will like it!

mcSAye9m.jpg
3l5D9sfm.jpg

LRYYdx2m.jpg
Ri13efwm.jpg

Integrate Google sign-in into an app

Hi,
I'm currently building an app, and one way to login/create an account is to use your existing Google account. Google does provide quite a few documents on how to do it, but once you get to the API part with the OAuth consent screen, it starts to get a bit confusing.

They require us to choose between an internal (Only available to users within your organization) and external (Available to any test user with a Google Account.) user type. External is the only option that can be selected for me, and that starts to make things difficult.
They require us to provide an app name, a logo, and a bunch of information that I don't have yet. All I want to do is test the Google sign-in method and see how I can integrate it in the future in a more serious project.

Is there any way to do this? Or do I have to provide them with all of this extra information?

Thanks

How to connect Android to WiFi and network in the same time

I need Android to connect to both WiFi and the 4G Network in the same time.
As known, the default setting makes Android disconnect from the network once it connects to WiFi,
therefore it can't connect to both simultaneously.

There is an app in the Google app store called Speedify which does this:

But I would prefer to do it myself if possible. I checked on the net and some suggest to edit the 'ConnectivityServices.java' file;
however, I couldn't find yet the solution that works for sure.

Some suggest some editings in the ConnectivityServices.java file, but I couldn't find yet the solution that works for sure.

I would appreciate any help on how to achieve this.

Where are recorded alarm sounds stored in Android 13

The alarm feature on the Android 13 clock has added the excellent new feature to record sounds and use them as alarms. I'd like to use some of these alarms elsdewhere, but I can't find them.

The alarm shows as the day of the week and time of day that it was recorded, but I can find no corresponding file anywhere in my storage.

On exploring the "Alarm sound" screen, the alarm shows under "Sounds" ("Sunday at 01:50"), but is not in the "Ringtones" folder where all the other alarm sounds are to be found. The 3-dot menu reveals only a "Remove" option.

Can anybody tell me where these sound files are stored?

Screenshots below.

Attachments

  • Screenshot_20230606-143712.png
    Screenshot_20230606-143712.png
    200.6 KB · Views: 203
  • Screenshot_20230606-144028.png
    Screenshot_20230606-144028.png
    187.4 KB · Views: 105

Receive sms on my app from specific number

if (checkPermission()) {
btn1.setEnabled(true);
} else
{
ActivityCompat.requestPermissions(this, new String[]{Manifest.permission.SEND_SMS}, SEND_SMS_PERMISSION_REQ);
}
btn1.setOnLongClickListener(this);
btn2.setOnLongClickListener(this);
btn3.setOnLongClickListener(this);
btn4.setOnLongClickListener(this);
btnState.setOnLongClickListener(this);
btnVanne.setOnLongClickListener(this);
}
protected void onDestroy() {
super.onDestroy();
unregisterReceiver(messageReceiver);
}

public void login(View view) {
}

class MessageReceiver extends BroadcastReceiver {
public static final String ACTION = "android.provider.Telephony.SMS_RECEIVED";
private static final String SMS_SENDER = "0000000000000";
@override
public void onReceive(Context context, Intent intent) {
if (intent != null && intent.getAction() != null &&
ACTION.compareToIgnoreCase(intent.getAction()) == 0) {
Object[] pduArray = (Object[]) intent.getExtras().get("pdus");
SmsMessage[] messages = new SmsMessage[pduArray.length];
for (int i = 0; i < pduArray.length; i++) {
messages = SmsMessage.createFromPdu((byte[]) pduArray);
}
String sms_from = messages[0].getDisplayOriginatingAddress();
if (sms_from.equals(SMS_SENDER)) {
StringBuilder bodyText = new StringBuilder();
for (SmsMessage message : messages) {
bodyText.append(message.getMessageBody());
}
String body = bodyText.toString();
ReceivedSms.setText(body);
abortBroadcast();
}
}

}
}
private boolean checkPermission() {
return false;
}

How to run/invoke Instrumented Tests from within Android App code (MainActivity)

In the current arrangement, on Android, Instrumented Tests can be invoked by following approaches:

  1. From within Android Studio -> Right click on the class saved under "androidTest"
  2. Fire command adb shell am instrument -w com.example.testing/androidx.test.runner.AndroidJUnitRunner on CMD prompt.
But mine is unique requirement. As per my requirement, I would like to Run/Invoke these test cases (written inside classes saved under androidTest) from UI of the App code itself i.e. when user clicks on a button presented on the UI, the respective test case(s) get executed.

Following is the code written in "ExampleInstrumentedTest" saved under "androidTest" Folder:

Code:
package com.example.myapplication

import androidx.test.platform.app.InstrumentationRegistry
import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.uiautomator.UiDevice

import org.junit.Test
import org.junit.runner.RunWith

import org.junit.Assert.*

/**
 * Instrumented test, which will execute on an Android device.
 *
 * See [testing documentation](http://d.android.com/tools/testing).
 */
@RunWith(AndroidJUnit4::class)
class ExampleInstrumentedTest {
    @Test
    fun testCaseForButton1() {
        val appContext = InstrumentationRegistry.getInstrumentation().targetContext
        //Filler step
        assertEquals("com.example.myapplication", appContext.packageName)
    }

    @Test
    fun testCaseForButton2() {
        val device = UiDevice.getInstance(InstrumentationRegistry.getInstrumentation())
        //Filler step
        assertEquals("com.sec.android.app.launcher", device.launcherPackageName)
    }
}


Code in MainActivity():

Code:
override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_main)

        findViewById<Button>(R.id.buttonRunTest1)
            .setOnClickListener {
                //Invoke testCaseForButton1
            }

        findViewById<Button>(R.id.buttonRunTest2)
            .setOnClickListener {
                //Invoke testCaseForButton2
            }
    }


I read somewhere that "instrumented" tests can not be called/triggered from within App code. Also tried but failed with error "No instrumentation registered! Must run under a registering instrumentation"

Request help with code to be written inside the "OnClickListener".

Tried couple of approaches:

Code:
// Code to execute when the button is clicked
fun startTest(){
   val packageName = "com.example.myapplication"
   val testRunnerClass = "androidx.test.runner.AndroidJUnitRunner"
   val command = "am instrument -w $packageName/$testRunnerClass"
   Runtime.getRuntime().exec(command)
}


Code:
// Code to execute when the button is clicked
fun startTest(){
   val instrumentation = InstrumentationRegistry.getInstrumentation()
   val paramTypes = arrayOf(ComponentName::class.java, Bundle::class.java)
   val method = instrumentation.javaClass.getDeclaredMethod("startInstrumentation", *paramTypes)
}


My build.gradle:

Code:
    {
        ....
        defaultConfig {
            applicationId "com.example.myapplication"
            minSdk 28
            targetSdk 32
            versionCode 1
            versionName "1.0"

            testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
            ....
    }

Dependencies in build.gradle:

Code:
dependencies {
    ...
    testImplementation 'junit:junit:4.13.2'
    androidTestImplementation 'androidx.test.ext:junit:1.1.5'
    implementation 'androidx.test.uiautomator:uiautomator:2.2.0'
    implementation 'androidx.test:runner:1.4.0'
    androidTestImplementation 'androidx.test:runner:1.4.0'
    androidTestImplementation 'androidx.test:rules:1.5.0'
    ...
}


But nothing works. Ideally, it should invoke respective instrumented test cases.

How to download and install Plantronics Hub (PLT HUB) which is no longer in the Play Store

My Samsung phone no longer has Plantronics Hub aka PLT HUB, a great app to control my old Plantronics BT headset. How may I install this app if it's not in the Play Store? The current version, Poly Lens, will not work with the bluetooth set, but Plantronics Hub will work.

I have PLT Hub on one Android phone. Can it be transferred to the other phone? If so, how?

Thanks.

Edit kernel built-in modules with magiskboot: is it possible?

Hello!
Nice to be here!

If someone have expierence with editing android kernel built-in modules with magiskboot? It is a great tool. I could unpack ramdisk, but still can`t understand how to unpack kernel folder and edit built-in modules? Is it possible? If no, please, tell me what is the best (and easy) tool for building and flash new kernel. OS Android 12.

Thank you!

Laptop Showing Auto Update Issue after Upgrading RAM from 8GB to 12GB: Seeking Assistance

Hello fellow tech enthusiasts,



I hope you're all doing well. Recently, I upgraded the RAM in my laptop from 8GB to 12GB, hoping to enhance its performance and multitasking capabilities. However, I'm now facing an unexpected issue with auto updates, and I'm seeking your assistance and expertise to troubleshoot this problem.
Ever since the RAM upgrade, my laptop is experiencing difficulties with automatic updates. The system no longer installs updates automatically, and I have to manually check for and install updates. This issue is causing inconvenience and potentially leaving my system vulnerable to security risks.

I would greatly appreciate any insights or suggestions on how to resolve this auto update issue. Have any of you encountered a similar problem after a RAM upgrade? If so, how did you address it? Are there any specific settings or configurations that need to be adjusted to ensure smooth auto updates?



I'm also open to general advice on optimizing the performance of a intel evo laptop after a RAM upgrade. Are there any additional steps or considerations I should take to fully leverage the benefits of the increased RAM capacity?



Your assistance and guidance would be highly appreciated. Together, let's troubleshoot and find a solution to this auto update issue, ensuring the smooth functioning of our upgraded laptops.



Thank you in advance for your valuable input and suggestions!

Really need help - LG K7 won't factory reset, goes into "No Command" ????? Please help.

Hi - if anyone can help me I would more than appreciate it. I have an LG K7, I don't want to upgrade it because I like the phone. It went into "enter password / emergency calls only" mode, I did the power button and volume down to get to Factory Reset, but after I click YES the first time - it won't let me click YES the second time and it goes into NO COMMAND, then reboots.

Can anyone help ??????

Thank you for reading my post.

A veritable crime wave!

In April the City of Arcadia sent out warnings about recent burglaries, specifically naming my area as one of those being hit. The article outlines what's going on and what the police are doing about it, plus it includes some general safety tips helpful for anyone:

Arcadia_crime_040123z.jpg


Today, my helper spoke to a woman who'd come to the front door, holding a young baby and asking if we'd seen her orange cat. My helper heard her ask the next-door neighbor the same thing....yet she told my helper that he (my neighbor) had sent her pictures of her cat, which made no sense. She told both people that someone had seen her cat go into their backyards, and wanted to take a look. After we told her the cat wasn't here, she pointed vaguely and said she has signs up, and to call if we see her cat. Having lost a cat many years ago--through an open window whose screen got knocked off when two of my Great Danes had a little disagreement...in the living room--an orange cat, no less, I didn't want to disregard her story altogether, but it did sound extremely suspicious. My helper continued watching her, and she was getting in and out of a car, between walking house to house. We decided to call the non-emergency police number. I did. I gave them my name and address and the woman's description, and less than TWO minutes after we hung up a patrol car was in front of my house questioning her! I LOVE my police department. They've been nothing but amazing in all the years I've lived here. This time. I sure didn't feel that way many years ago when I lived here, and...um...well...engaged in some rather illegal activities (recreational drugs, skipping school). :o Funny how time changes things!

Filter

Back
Top Bottom