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

AOSP: Can't Run Emulator

I'm a AOSP newbie. I am following this tutorial.

I have successfully synced my repo to tag android-11.0.0_r29.

I set lunch to aosp_arm-eng. The build reports:

Code:
...
[ 99% 90444/90520] //art/build/apex:art-check-debug-apex-gen generate art-check-debug-apex-gen.dummy
--bitness=auto, trying to autodetect. This may be incorrect!
  Detected multilib
[100% 90520/90520] Target vbmeta image: out/target/product/generic_arm64/vbmeta.img

#### build completed successfully (05:25:57 (hh:mm:ss)) ####

However, when I attempt to run the emulator:

Code:
clayton@ubuntu-20-aosp:~/aosp$ emulator
emulator: ERROR: Can't get kernel version from the kernel image file: '/home/clayton/aosp/prebuilts/qemu-kernel/arm64/ranchu/kernel-qemu'

Have not found a solution. Please help.

Deleted phone back up

My old 3a got water damage and wont turn on .i got a new pixel 5 and when I set it up from the 3a backup it asked for the security pattern (from the 3a)i accidently did too many wrong tries and then it said that the backup had been permanently deleted. Tried re setting again and sure enough the backup 3a option is gone.
The 3a backup still appears in google drive, so my question is how can I utilize this backup again? Is it permanently deleted? Why does it still appear in google drive? Am desperate as I need to get the call logs and sms logs from the 3a backup. Any help would be greatly appreciated

Help Oppo R11 Plus wont recognise Smart doorbell

My Oppo R11 Plus is running Android 8.1.0, connected to EE Fibre Broadband WiFi Router set to 2.4Gz band only.
I bought an "XSmart" video doorbell, Model # X20D00H002 last month. (2.4Gz band working only)
I've tried using the manufacturers recommended Play Store Android App for the video doorbell ( "Ubox") plus another App advised for the "XSmart" models on YouTube ("XSH Cam") with ALL the settings correctly inputed but am having problems.
On both Apps. when "adding new device" (the video doorbell) I can use the displayed "QR" code to get the doorbell to connect itself to my home EE Network, but boths Apps then fail to recognise the doorbell as a new device and add the doorbell to its' list of devices. Tried countless times with no success.
I even tried downloading both Apps to my wife's Samsung Galaxy A10 phone, with the same failures.
Has anyone else had similar problems, and how do I get my Oppo phone to recognise the Doorbell as a new device? Thanks! David (UK).

David, is it this app?
https://play.google.com/store/apps/details?id=cn.ubia.ubox
Looking at the many one star reviews, seems there's many users having the similar problems with it, with things like "Garbage, you can't connect devices..."

Suggest you return the video doorbell as unsatisfactory for a refund. And quite frankly cheapo no-name smart doorbells, and other cheapo IoT devices should be avoided as they might be unreliable, and may even be a security risk.

My new LG G7 ThinQ has a TV app on it

This phones was obviously from Korea but is brand new, brought on ebay

But it has a TV app that scans for channels and asks me to connect my headphones in the same ways as the FM radio

Doesn't pick anything up though, I assume its tuned to Korean TV wave-lengths.

Would this be hard-coded on to the chip or is it possible to change these values in another LG app or TV app

Never heard of such a thing in my life

It's for receiving DMB(Digital Multimedia Broadcasting) on VHF and UHF, only used in South Korea and China AFAIK. And it does use the headphone cable plugged in as an antenna, similar to FM radio. Some older phones actually had a telescopic antenna for receiving it. I suspect it is hard coded into the SoC, like FM radio, and if it can be changed by firmware or not, no idea. There are other TV apps, but they usually stream via the internet, e.g. Hulu, iPlayer, etc.

Auto Suggest not showing most useful suggestion.

Hi all was wondering if anyone knows how to set this up. I'm not even sure if my title explains it properly but here is my dilemma.

for example

I have a row widget placed in my project.

under row I want to adjust my mainAxisAlignment: //here if I start to type the word 'center' I'd expect 'MainAxisAlignment.center' to show up near the top of the suggestion list yet it is more near the bottom and I have to scroll thru the list to get to it.

See attached image. also I made sure that sort by name is unchecked yet the behavior persists.

Does anyone know how to change this behavior?

Thanks in Advance.

Attachments

  • Project1.jpg
    Project1.jpg
    110.3 KB · Views: 169

Apps Help with Wifi Scanning via app

The function wifiManager.startScan() does not return any results when tested on a device instead of in the emulator. After searching around I found posts from 2 years ago stating that for API 26+ the wifiManager was changed to work differently. My question is: how to get it to work, aka to return me the list of available wifi networks to connect?

I have a button and a listview and on create I enable the wifi. When the button is pressed I scan for wifi networks and populate the listview with their names. Upon clicking a list item a pop asking for the wifi passwords appears. Afterwards it attempts to connect via the network name and the entered password.

Here is my current code (although I have a lot of experience in programming, I have little experience in Android Studio, so everything is crammed in one script). It works in the emulator (I get the predefined wifi network and successfully connect to it). On a device, however, it doesn't find any wifi networks despite seeing 4-5 when opening my wifi settings from the top navbar and not from the app. The three commented out lines are what I found I'm supposed to do to get the wifiManager to get scan results on API 26+ (though I probably put it in the wrong place due to my limited knowledge of Android Studio)

Java:
package com.example.bla;

import android.Manifest;
import android.annotation.SuppressLint;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.IntentFilter;
import android.content.pm.PackageManager;
import android.net.wifi.ScanResult;
import android.net.wifi.WifiConfiguration;
import android.net.wifi.WifiManager;
import android.net.wifi.WifiNetworkSuggestion;
import android.os.Build;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.AdapterView;
import android.widget.ArrayAdapter;
import android.widget.Button;
import android.widget.EditText;
import android.widget.ListView;
import android.widget.Toast;

import androidx.annotation.NonNull;
import androidx.appcompat.app.AlertDialog;
import androidx.appcompat.app.AppCompatActivity;
import androidx.core.app.ActivityCompat;
import androidx.core.content.ContextCompat;

import java.util.ArrayList;
import java.util.List;

public class MainActivity extends AppCompatActivity {

    private WifiManager wifiManager;
    private ListView listView;
    private Button buttonScan;
    private int size = 0;
    private List<ScanResult> results;
    private ArrayList<String> arrayList = new ArrayList<String>();
    private ArrayAdapter adapter;
    private int REQUEST_LOCATION = 101;
    private EditText input;
    private AlertDialog ad;

    private int ItemNumb;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        buttonScan = findViewById(R.id.scanBtn);
        buttonScan.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                scanWifi();
            }
        });

        listView = findViewById(R.id.wifilist);
        wifiManager = (WifiManager) getApplicationContext().getSystemService(Context.WIFI_SERVICE);

        if (!wifiManager.isWifiEnabled()) {
            Toast.makeText(this, "Wifi is disabled... Enabling it", Toast.LENGTH_LONG).show();
            wifiManager.setWifiEnabled(true);
        }

        adapter = new ArrayAdapter<>(this, android.R.layout.simple_list_item_1, arrayList);
        listView.setAdapter(adapter);

        AlertDialog.Builder alertBuilder = new AlertDialog.Builder(MainActivity.this);
        alertBuilder.setTitle("Connect to network?");
        alertBuilder.setMessage("Please enter network password");
        input = new EditText(MainActivity.this);
        alertBuilder.setView(input);
        alertBuilder.setPositiveButton("Submit", new DialogInterface.OnClickListener() {
            @Override
            public void onClick(DialogInterface dialogInterface, int i) {
                connectToNetwork("\"" + results.get(ItemNumb).SSID.toString() + "\"", input.getText().toString());
            }
        });
        alertBuilder.setNegativeButton("Cancel", new DialogInterface.OnClickListener() {
            @Override
            public void onClick(DialogInterface dialogInterface, int i) {
                dialogInterface.dismiss();
            }
        });

        ad = alertBuilder.create();

        listView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
            @Override
            public void onItemClick(AdapterView<?> adapterView, View view, int i, long l) {
                ItemNumb = I;
                ad.show();
            }
        });

        //IntentFilter intentFilter = new IntentFilter();
        //intentFilter.addAction("android.net.wifi.SCAN_RESULTS");
        //registerReceiver(wifiReceiver, intentFilter);
    }

    private void scanWifi() {
        if (ContextCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED) {
            requestPermissions(new String[]{Manifest.permission.ACCESS_FINE_LOCATION}, REQUEST_LOCATION);
        }
        if (ContextCompat.checkSelfPermission(this, Manifest.permission.ACCESS_WIFI_STATE) != PackageManager.PERMISSION_GRANTED) {
            requestPermissions(new String[]{Manifest.permission.ACCESS_WIFI_STATE}, REQUEST_LOCATION);
        }
        arrayList.clear();
        registerReceiver(wifiReceiver, new IntentFilter(WifiManager.SCAN_RESULTS_AVAILABLE_ACTION));
        wifiManager.startScan();
        Toast.makeText(this, "Scanning Wifi...", Toast.LENGTH_SHORT).show();
    }

    @Override
    public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) {
        if (grantResults.length == 0 || grantResults[0] != PackageManager.PERMISSION_GRANTED) {
            Toast.makeText(getApplicationContext(), permissions[0] + " permission refused", Toast.LENGTH_SHORT).show();
        } else {
            Toast.makeText(getApplicationContext(), permissions[0] + " permission granted", Toast.LENGTH_SHORT).show();
        }
    }

    BroadcastReceiver wifiReceiver = new BroadcastReceiver() {
        @Override
        public void onReceive(Context context, Intent intent) {
            results = wifiManager.getScanResults();
            unregisterReceiver(this);

            for (ScanResult scanResult : results) {
                arrayList.add(scanResult.SSID + " - " + scanResult.capabilities);
                adapter.notifyDataSetChanged();
            }
        }
    };

    private void connectToNetwork(String networkSSID,  String networkPass)
    {
        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q)
        {
            WifiNetworkSuggestion networkSuggestion1 =
                    new WifiNetworkSuggestion.Builder()
                            .setSsid(networkSSID)
                            .setWpa2Passphrase(networkPass)
                            .build();

            WifiNetworkSuggestion networkSuggestion2 =
                    new WifiNetworkSuggestion.Builder()
                            .setSsid(networkSSID)
                            .setWpa3Passphrase(networkPass)
                            .build();

            List<WifiNetworkSuggestion> suggestionsList = new ArrayList<>();
            suggestionsList.add(networkSuggestion1);
            suggestionsList.add(networkSuggestion2);

            wifiManager.addNetworkSuggestions(suggestionsList);
        }
        else
        {
            WifiConfiguration wifiConfiguration = new WifiConfiguration();
            wifiConfiguration.SSID = String.format("\"%s\"", networkSSID);
            wifiConfiguration.preSharedKey = String.format("\"%s\"", networkPass);
            int wifiID = wifiManager.addNetwork(wifiConfiguration);
            wifiManager.enableNetwork(wifiID, true);
        }
    }
}

I'm developing an app for the less technologically capable. For that purpose the app itself enables wifi, lists networks and lets you connect to a preferred network via the app rather than having you manually do it from the top android navbar. This is a non-negotiable product requirement, so I'm searching for solutions on how to change my code to get the wifi list successfully for API 26+ and not suggestions for alternate designs.

Filter

Back
Top Bottom