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

Emulator Problem

For a month now I've not been able to get a proper function from my emulator. Here's a group of error messages I get today in the Event log:

I would have removed this thread since I moved it to App Development but I don't see a link to remove it from this area.


Code:
9/17/2019
6:03 AM    * daemon not running; starting now at tcp:5037

6:03 AM    * daemon started successfully

6:03 AM    Gradle sync started with single-variant sync

6:03 AM    Project setup started

6:03 AM    Gradle sync finished in 3 s 989 ms (from cached state)

6:04 AM    Executing tasks: [:app:generateDebugSources] in project C:\Users\Shelby\AndroidStudioProjects\JavaArrays

6:04 AM    NDK Resolution Outcome: Project settings: Gradle model version=5.4.1, NDK version is UNKNOWN

6:04 AM    Gradle build finished in 30 s 252 ms

6:08 AM    Executing tasks: [:app:assembleDebug] in project C:\Users\Shelby\AndroidStudioProjects\JavaArrays

6:08 AM    Emulator: dsound: Could not initialize DirectSoundCapture

6:08 AM    Emulator: dsound: Reason: No sound driver is available for use, or the given GUID is not a valid DirectSound device ID

6:08 AM    Emulator: dsound: Attempt to initialize voice without DirectSoundCapture object

6:08 AM    Emulator: dsound: Attempt to initialize voice without DirectSoundCapture object

6:08 AM    Emulator: audio: Failed to create voice `goldfish_audio_in'

6:08 AM    Emulator: C:\Users\Shelby\AppData\Local\Android\Sdk\emulator\qemu\windows-x86_64\qemu-system-x86_64.exe: warning: opening audio input failed

6:08 AM    Emulator: dsound: Attempt to initialize voice without DirectSoundCapture object

6:08 AM    Emulator: dsound: Attempt to initialize voice without DirectSoundCapture object

6:08 AM    Emulator: audio: Failed to create voice `adc'

6:08 AM    Emulator: dsound: Attempt to initialize voice without DirectSoundCapture object

6:08 AM    Emulator: dsound: Attempt to initialize voice without DirectSoundCapture object

6:08 AM    Emulator: audio: Failed to create voice `adc'

6:09 AM    Gradle build finished in 17 s 347 ms

6:09 AM    Install successfully finished in 566 ms.: App restart successful without requiring a re-install.

6:09 AM    Executing tasks: [:app:assembleDebug] in project C:\Users\Shelby\AndroidStudioProjects\JavaArrays

6:09 AM    Gradle build finished in 3 s 339 ms

6:09 AM    Install successfully finished in 667 ms.: App restart successful without requiring a re-install.

Here's the entire project which I am building from an android classroom from udemy.com by my instructor .

Code:
package com.swayzeconstruction.javaarrays;

public class Main {
    public static void main(String[] args) {
        String[] names = new String[5];
        names[0] = "Shelby";
        names[1] = "Jaam";
        names[2] = "Bisous";
        names[3] = "Felix";
        names[4] = "Hadi";

        System.out.println(names[3]);
        int[] numbers = new int[5];  //apparently gives all values of array
        //or the following
    }

    {
        String[] names2 = new String[5];
        System.out.println(names2[2]);  //gives second value of array
        // or the following
    }

    {
        String[] names3 = new String[5];
        {
            System.out.println(names3[2]);
            int[] numbers = {1, 2, 3, 4, 5};  //note: using curly braces
            System.out.println(numbers[1]);   // to get second element
        }

    }
}

Any ideas? Thanks

Instagram - Retrofit

Hello friends,
The following url returns the user's followers as json if the user logged in to instagram in the browser. If no input is made, the data is not returned.
How do I set a user's login status when sending a request to this url with Retrofit on Android? I think this url will return empty data again if no login is made.

Example
https://www.instagram.com/graphql/query/?query_id=17874545323001329&id=427553890&first=20

System doesn't unmute notifications

When I mute using the hot key in the tray, all options go to mute. However, when I deselect same button and return soind, media & calls return to same level as before however the notifications option stays mutted. It didn't always do this but it's been going on for at least a few months. I'm up to date on system updates. Android 9 Kernal 4.4.153 July 31.

Any known fixes?

Root Format Write-protected Encrypred SD card

I used a 64GB SanDisk SD card in Lenovo K4 Note as internal storage. After the phone got reset, I realized the SD card is still encrypted. I retrieved data using Linux recovery tools. After retrieving the data, I am trying to format the SD card but I am getting Read-write error on Fedora and Cyclic Redudancy Check on Windows. I am sure that the SD card is write-protected and I am able to read the data. Is there any Android tool that I can use to flash the SD card and make it reusable. I am okay to explore to fix even the cylinders and sectors of the SD card.

Higher FPS drains battery faster and heats faster?

Hello people. I just want to confirm. If a heavy game set in highest settings that gives 60+ FPS, would that drain battery faster than lower FPS?
then does that mean flagships drain battery faster than midrange in max settings heavy gaming?
And does steady 60 FPS in flagship heats faster than midrange too?
I read that when playing a heavy game in max settings on midrange phones, it will drop below 60 fps, what is the lowest FPS that you will notice that does not look like 60 fps smooth? Is it 30? Thank you!

Help Android remote support API follows the NIST 800-80 guidelines?

Does android remote support API follows the NIST 800-80 guidelines on device wipe operation ? if yes it falls under "clear" or "purge" operations

Below APi used to wipe device
https://developer.android.com/reference/android/app/admin/DevicePolicyManager.html#wipeData(int)

NIST 800-80 Guide
https://nvlpubs.nist.gov/nistpubs/SpecialPublications/NIST.SP.800-88r1.pdf

Tech Dummie...101

I would like some options about changing my backgrounds and keyboards without messing up the system...NO LAUNCHER however I am now terrified of what I can install or dowload.. I had a few questions I had already put out there...one being confusing about my phone being HACKED it was google fixed it!!! anyways...I want to learn every thing i can now about technology... Tech Dummie thats me and I'm not ashamed so help me out...


Tech Dummie
Samsung Galaxy Edge 7s...Android pie 9

Android 9 Microphone feedback

My wife just got a new Galaxy S9. I noticed that it was significantly harder to hear her when we were talking. After a lot of troubleshooting, I've believe the problem is that her microphone is picking up the sounds coming from her speakers and canceling out all noises from being recorded. This happens when she has me on speaker phone as well as while we are in a video chat with Duo, Hangout, Skype, or Messenger (like I said, a lot of troubleshooting lol).

Is there a way to adjust the noise reduction or ambient noise threshold in Android 9?

Thank you in advance!

Help How to RE-fix volume level on FiiO M7

I don't know much of anything about Android systems, so I'm hoping someone can help me here. I use a FiiO M7 as my main music player, and primarily I use my AirPods with it. When I first paired them, I noticed the volume level was very low, even at the maximum setting. After some googling, I enabled developer options, and set the Disable Absolute Volume setting to ON. That fixed the problem, and it's been fine until about a week ago, when it suddenly reverted back to the quieter volume levels. It might worth mentioning that I regularly switch the AirPods between my iPhone and the FiiO, but again, until now this has gone without issue.

I've now unpaired, forgotten, re-paired, restarted the device, switched that setting off and on several times (and all of these in every possible order), and done a complete factory reset, and the low volume persists. I'm wondering what else I could try to get this fixed.

I've read that the Android OS this device runs on is a very pared down version: it says

Kernel version 3.18.14-user-g3a4465b-dirty
FiiO@asc #112
Build number 1.0.2

Is there something I'm missing here?Is there a VERY specific order I need to be following these steps in that I'm somehow failing?

updating listView as data is received

So I'm attempting to write my first android application to support another project I'm working on. I send out a command to a USB attached device. The data packets are sent back over the wire, received, parsed, added to a database, and supposed to be added to an adapter in order to display in a list view. I attempted to follow instructions I found on a skill share video in order to implement the adapter. I was able to get the application from skill share working, an rss feed, but I'm attempting to make the same functionality work, but as data comes in and stored into the database, the adapter is updated to display the most recent data on the list view.

I have the buttons, send and receive, and a couple other things working in the main activity thread. As I receive data from the attached device I'm adding packets to a Queue.

Java:
@Override
        public void handleMessage(Message msg) {
            switch (msg.what) {
                case UsbService.MESSAGE_FROM_SERIAL_PORT:
                    String packet = (String) msg.obj;

                    mActivity.get().dataPacket.append(packet);

                    if(lastCMD.equals("R07") || lastCMD.equals("R08" ))
                    {

                        if(mActivity.get().dataPacket.length() > 455)
                        {
                            String data = mActivity.get().dataPacket.toString();

                            data = data.replaceAll("[\\^\\*:]", "");

                            String[] split = data.split("\\r?\\n");

                            for(int i = 0; i < split.length; i++)
                            {

                                mActivity.get().dataR.add(split[i]);
                            }
                        }
                    }
...

I have another class running as its own thread. This thread handles the data that's stored into the Queue. If the Queue has data it will follow the operations to parse the packet lines and add them to the database.

Java:
class OperationThread extends Thread
{

    private MainActivity obj;

    private String data;
    private String time;
    private String temp;
    private String conc;
    private String batchNum;
    private String fileNum;
    private float temporary;

    SensorRecord record;

    OperationThread(MainActivity obj)
    {

        this.obj = obj;
    }

    public void run()
    {

        try
        {
            Thread.sleep(500);
        } catch (InterruptedException e)
        {
            e.printStackTrace();
        }

        super.run();

        while (!Thread.currentThread().isInterrupted())
        {

            if(!obj.dataR.isEmpty())
            {
                try
                {
                    data = obj.dataR.remove();

                    data = data.replaceAll("\\s", "");

                    String[] breakout = data.split("-");
                    // all set to this point
                    if(breakout.length == 12)
                    {

                        batchNum = breakout[0];
                        fileNum = breakout[1];

                        time = breakout[2] + ":" + breakout[3] + ":" + breakout[4] + ":" + breakout[5] ;

                        if(checksum(breakout[8]))
                        {
                            temporary = (float) Integer.parseInt(breakout[8].substring(breakout[8].length()-4, breakout[8].length()-2), 16);
                            temporary = temporary * (float) .1;
                            temp = String.valueOf( temporary);
                        }
                        else
                            temp = "Chksm Err";

                        if(checksum(breakout[11]))
                        {
                            temporary = (float) Integer.parseInt(breakout[11].substring(breakout[11].length()-4, breakout[11].length()-2));
                            //temporary = temporary *
                            conc = String.valueOf(temporary);
                        }
                        else
                            conc = "Chksm Err";

                        record = new SensorRecord(batchNum, fileNum, time, temp, conc);

                        obj.db.addSensorRecord(record);

                   }
                }
                catch (NoSuchElementException e)
                {}

                obj.runOnUiThread(new Runnable()
                {
                    @Override
                    public void run ()
                    {
         
                        obj.adapter.notifyDataSetChanged();
                    }
                });
            }// end of if
        }
    }

    private boolean checksum(String data)
    {

        int length = data.length();
        boolean ck = false;
        int checksum = 0;
        int n = 0;

        String iChksm = data.substring(data.length()-2);

        for (n = 0; n < length - 2; n++)
        {
            checksum = checksum + data.charAt(n);
        }
        checksum = 255 - checksum + 1;
        checksum = checksum + 256 + 256;

        if (Integer.parseInt(iChksm, 16) == checksum)
            ck = true;

        return ck;
    }
}

I use runOnUiThread to add new requests to the stack of UI Thread. The call I thought would work was the notifyDataSetChanged(). But it doesn't update with any of the data coming in over the wire. All I see is blank lines, hundreds of them.

I create and set the adapter in the onCreate of the activity.

All functionality of the main activity has worked thus far. But after hitting the Read Sensor button, nothing populates in the List view and then, all functionality from Sync or the settings activity fail to work.

Could someone lend some insight as to where I should be looking. I'm not getting any errors, Its hard to debug when Its not connected to Android Studio. With that being said, I have a second application that I use to test all of the data parsing and verify that the data coming in over the wire is what its suppose to be. I have tested all the calls, send/receive, parsing, and etc on this second application first.

Here is the Adapter class

Java:
package com.ascenzi.rhmps;

import android.content.Context;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.TextView;

import org.w3c.dom.Text;

import java.util.List;

public class SensorFeedAdapter extends ArrayAdapter<SensorRecord>
{
    Context context;
    String aBatchNum;
    String aFileNum;
    String aTime;
    String aTemp;
    String aConc;


    public SensorFeedAdapter (Context c, List<SensorRecord> records)
    {
        super(c, 0, records);


    }


    @Override
    public View getView (int position, View convertView, ViewGroup parent)
    {

        SensorRecord record = getItem(position);

        if (convertView == null)
            convertView = LayoutInflater.from(getContext()).inflate(R.layout.sensor_feed_item_row, parent, false);

        TextView batch =convertView.findViewById(R.id.batchTextView);
        TextView file = convertView.findViewById(R.id.fileTextView);
        TextView time = convertView.findViewById(R.id.timerTextView);
        TextView temp = convertView.findViewById(R.id.tempTextView);
        TextView conc = convertView.findViewById(R.id.concenTextView);

        batch.setText(aBatchNum);
        file.setText(aFileNum);
        time.setText(aTime);
        temp.setText(aTemp);
        conc.setText(aConc);

        return convertView;
    }
}

and here is the instantiation of the adapter class.

Java:
        adapter = new SensorFeedAdapter(this, records);
        sensorFeedList.setAdapter(adapter);

App Downloaded from Play Store Crash

I have published a simple game to learn the publishing process, Popprz, on both Apple and Google developed using Cocos2d-x.

The downloaded & installed game runs happily on some devices, Huawei P10 & Samsung Galaxy 10 for example, but crashes on a Samsung S6 & Honor 8 Pro.

When I try to debug the issue from Android Studio I find I can happily debug the same app on, for example, the Samsung S6 & Honor 8 Pro - no problems :[

Can anyone suggest how I should try and identify the problem(s)?

Thanks

SQL JSON get array instead of object

Hi.

i am using this code to get some info from a sql database.

I can't figure out how to return a array if there are more than one record with the same email.


Somehow i have to put the $stmt->fetch(); in a while function and then array_push it together i think.

in java then create a array and load it in to it.

Can someone help??


Regards Danni.


PHP:
Code:
if (!empty($_POST)) {

    $response = array("error" => FALSE);

    $query = "SELECT * FROM users WHERE email = :email";

    $query_params = array(
        ':email' => $_POST['email']
    );

    try {
        $stmt = $db->prepare($query);
        $result = $stmt->execute($query_params);
    }

    catch (PDOException $ex) {
        $response["error"] = true;
        $response["message"] = "Database Error 1";
        die(json_encode($response));
    }

    $validated_info = false;
    $email = $_POST['email'];

    $row = $stmt->fetch();

        $response["error"] = false;
        $response["user"]["uid"] = $row["unique_id"];
        $response["user"]["name"] = $row["name"];
        $response["user"]["email"] = $row["email"];

        die(json_encode($response));

}

JAVA:
Code:
StringRequest strReq = new StringRequest(Request.Method.POST,
                Functions.LOGIN_URL, new Response.Listener<String>() {

            @Override
            public void onResponse(String response) {
                Log.d(TAG, "Login Response: " + response);
                hideDialog();

                try {
                    JSONObject jObj = new JSONObject(response);
                    boolean error = jObj.getBoolean("error");

                    // Check for error node in json
                    if (!error) {
                        // user successfully logged in
                        JSONObject json_user = jObj.getJSONObject("user");

                    } 
                } catch (JSONException e) {
                    // JSON error
                    e.printStackTrace();
                    Toast.makeText(getApplicationContext(), "Json error: " + e.getMessage(), Toast.LENGTH_LONG).show();
                }

            }
        }, new Response.ErrorListener() {

        }) {

            @Override
            protected Map<String, String> getParams() {
                // Posting parameters to php
                Map<String, String> params = new HashMap<String, String>();
                params.put("email", email);

                return params;
            }

        };

System doesn't unmute notifications

When I mute using the hot key in the tray, all options go to mute. However, when I deselect same button and return soind, media & calls return to same level as before however the notifications option stays mutted. It didn't always do this but it's been going on for at least a few months. I'm up to date on system updates. Android 9 Kernal 4.4.153 July 31.

Any known fixes?

Tech Dummie 101 help

I recently had the pie 9 update on phone which by the way I could hardly work it for a month. I'm that person that loves changing the back and the key Board
..
But oviously not good download this down....not good...I know something or someone is on my phone now but it looks like there protect it..Amways 1st time need navigation and def the best themes having nova launcher

Filter

Back
Top Bottom