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

Apps "App is draining battery" notification

Hello,

We have a driving behavior monitoring app that requires gathering location and sensor data from phone in background when the user is driving a vehicle. We take the requisite permissions from user during onboarding to be able to access Location All the time. We also optimise the data collection to reduce battery consumption. Still, some of our users get a sporadic message generated by Android that our App is draining the battery.

Is there any Android documentation that defines the criteria on when such a notification is shown. If the user ignores the notification, will it still keep coming. Is there anything a developer can do to prevent that notification from popping up.

Thanks

Help Rooting of Mediapad M5

I have tried different downloads to root and all of them come up with an error. Is there a specific way you would recommend?
what downloads are we talking about? where did you get these downloads from? do you have a link? like i said the more details you give us the better we can help.

as far as what i recommend? always head on over to xda for all things root related for any device. if a device does not have a specific forum than the device does not have much of a community.

however your device is listed so your tablet does have support.....though most threads were started in 2018 so i', not so sure how up to date things will be.

anyways the above link should work as well as this one:
https://forum.xda-developers.com/t/root-root-guide-for-huawei-mediapad-m5.3786157/

not sure what is the difference in methods as i have not read them.

Read data from Google Sheets

Hello everyone,
I have been trying since days to read data from Google Sheets into a list view. I was referring to tutorials from Crazy Coders Club. The write operation works well, however, the read operation either shows nothing or makes the app crash. I am adding below my codes, and I will be grateful if someone could help me figure out the problem.

Here are my spreadsheet link: https://docs.google.com/spreadsheets/d/1Bccu6dyOIV5lF-be_95LDYkdFEdqtBYKhNDE97nv_Ss/edit?usp=sharing

and Google Scripts link: https://script.google.com/d/1HdmpUP...1uOzcZclQNm0mlxDK1QeKlz-9KFo/edit?usp=sharing

XML:
Code:
<?xml version="1.0" encoding="utf-8"?>
<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">


    <ListView
        android:id="@+id/lv_items"
        android:layout_width="0dp"
        android:layout_height="0dp"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toTopOf="parent" />

</androidx.constraintlayout.widget.ConstraintLayout>

XML (leaderboard_item):
Code:
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout 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"
    xmlns:app="http://schemas.android.com/apk/res-auto">


    <LinearLayout
        android:layout_width="350dp"
        android:layout_height="90dp"
        android:orientation="horizontal"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toTopOf="parent"
        app:layout_constraintVertical_bias="0.1">

        <androidx.constraintlayout.widget.ConstraintLayout
            android:layout_width="match_parent"
            android:layout_height="80dp"
            android:background="#EAE8E8">

            <TextView
                android:id="@+id/username"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_marginStart="50dp"
                android:fontFamily="@font/league_spartan_bold"
                android:text="TextView"
                android:textColor="@color/colorPrimaryDark"
                android:textSize="20sp"
                app:layout_constraintBottom_toBottomOf="parent"
                app:layout_constraintEnd_toEndOf="parent"
                app:layout_constraintHorizontal_bias="0.0"
                app:layout_constraintStart_toStartOf="parent"
                app:layout_constraintTop_toTopOf="parent" />

            <TextView
                android:id="@+id/score"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_marginEnd="20dp"
                android:fontFamily="@font/sanchez"
                android:text="TextView"
                android:textColor="@color/colorTextDark"
                app:layout_constraintBottom_toBottomOf="parent"
                app:layout_constraintEnd_toEndOf="parent"
                app:layout_constraintHorizontal_bias="1.0"
                app:layout_constraintStart_toStartOf="parent"
                app:layout_constraintTop_toTopOf="parent" />

            <TextView
                android:id="@+id/rank"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_marginStart="20dp"
                android:fontFamily="@font/sanchez"
                android:text="1"
                android:textColor="@color/colorTextDark"
                android:textSize="20sp"
                android:textStyle="bold"
                app:layout_constraintBottom_toBottomOf="parent"
                app:layout_constraintEnd_toEndOf="parent"
                app:layout_constraintHorizontal_bias="0.0"
                app:layout_constraintStart_toStartOf="parent"
                app:layout_constraintTop_toTopOf="parent" />

        </androidx.constraintlayout.widget.ConstraintLayout>
    </LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout>

Java Code:
Code:
package com.example.aquatricity;

import android.app.ProgressDialog;
import android.os.Bundle;
import android.widget.EditText;
import android.widget.ListAdapter;
import android.widget.ListView;
import android.widget.SimpleAdapter;
import android.widget.TextView;

import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;

import com.android.volley.DefaultRetryPolicy;
import com.android.volley.Request;
import com.android.volley.RequestQueue;
import com.android.volley.Response;
import com.android.volley.RetryPolicy;
import com.android.volley.VolleyError;
import com.android.volley.toolbox.StringRequest;
import com.android.volley.toolbox.Volley;

import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;

import java.util.ArrayList;
import java.util.HashMap;

public class Leaderboard extends AppCompatActivity {

    ProgressDialog loading;
    ListView listview;
    ListAdapter adapter;

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

        listview = (ListView) findViewById(R.id.lv_items);

        getUsers();

    }


    private void getUsers() {

        loading =  ProgressDialog.show(this,"Loading","please wait",false,true);

        StringRequest stringRequest = new StringRequest(Request.Method.GET, "https://script.google.com/macros/s/AKfycbzvfbIcBrm6UXpK3xphHor2azlk1dZxar28_6z8PFI7xDyNq4xnQ-m4Gs80A3Y8ZspT_Q/exec?action=getUsers",
                new Response.Listener<String>() {
                    @Override
                    public void onResponse(String response) {
                        parseItems(response);
                    }
                },

                new Response.ErrorListener() {
                    @Override
                    public void onErrorResponse(VolleyError error) {

                    }
                }
        );

        int socketTimeOut = 50000;
        RetryPolicy policy = new DefaultRetryPolicy(socketTimeOut, 0, DefaultRetryPolicy.DEFAULT_BACKOFF_MULT);

        stringRequest.setRetryPolicy(policy);

        RequestQueue queue = Volley.newRequestQueue(this);
        queue.add(stringRequest);

    }


    private void parseItems(String jsonResposnce) {

        ArrayList<HashMap<String, String>> list = new ArrayList<>();

        try {
            JSONObject jobj = new JSONObject(jsonResposnce);
            JSONArray jarray = jobj.getJSONArray("Users");
            HashMap<String, String> user = new HashMap<>();

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

                JSONObject jo = jarray.getJSONObject(i);

                String displayName = jo.getString("displayName");
                String email = jo.getString("emailAddress");
                String pass = jo.getString("password");
                String phoneNumber = jo.getString("phoneNumber");
                String score = jo.getString("score");
                String rank = jo.getString("rank");
                String house = jo.getString("household");



                user.put("displayName", displayName);
                user.put("rank", rank);
                user.put("score",score);

                list.add(user);

            }
            
        } catch (JSONException e) {
            e.printStackTrace();
        }

        adapter = new SimpleAdapter(this,list,R.layout.leaderboard_item,
                new String[]{"displayName","rank","score"},new int[]{R.id.username,R.id.rank,R.id.score});


        loading.dismiss();
    }
}

Help Hard resetting/Powerwashing an android device

^this.

If you don't know about factory reset protection, it's an anti-theft measure introduced in 2015. The logic behind it is to make theft less attractive: previously someone could steal a phone, reset it then use or sell it. With FRP the phone can't be used after a reset unless you enter the previous login details, making it less worthwhile for a thief to steal in the first place (if a legitimate owner wants to sell the phone they need to remove their account from it before doing a reset). This does however make it very important that you don't forget your password: by definition if there is any way for you to bypass this then a thief can use that too, which would make the whole thing pointless. Hence it is designed not to have any workarounds, and where a bug does allow a way the manufacturer tends to patch it as soon as they become aware.

Apple introduced a similar system a bit before Android, so I'm afraid it's been a long time since resetting has been a solution to a forgotten password on any phone.

Allow an app to download another app?

It's odd, I never gave permission for Boinc to download and run executables, and yet it can. Maybe I did years ago, since I used a Samsung utility to copy all the apps from my old Android 7 phone to this one, so it might have copied permissions. But there definitely aren't permissions for Boinc to do that when I look at it's info.

Yoyo said they had no interest in fixing it two years ago when someone else complained. I guess they designed it badly and got away with it until android got more secure. boinc is not the easiest thing to work with, they probably tried and failed to get it's own downloader to function. When you say "Boinc team" - actually that's one guy, a volunteer out of work programmer. nothing ever gets fixed.

My Android 4 phone is absolutely awful at security, it's full of Adware and nothing even rooting gets rid of it, every single time I turn on the screen a browser opens with an advert. Probably (knowing the source) it was injected into the OS at the factory.

Round air vent smartphone holders??

I'm trying to find an air vent holder for my wife's 2017 Toyota Yaris but have had no luck so far. I've purchased 2 on Amazon and neither fit her vents. Do any of you have a Yaris or another model with round air vents and have a mount that fit them? Just to clear, it's not that the shape of the air vent that's the issue. It's the fact that the fins are round/curved as well.

Mark in San Diego

Auto Text Backup?

I prefer exporting messages directly to internal storage or MicroSD, so I can browse them on the PC and avoid vendor lock-in. With root, the directory they are stored in, presumably somewhere in /data/, would be directly accessible.
It would be, but you'd find they were in a database rather than a set of files, so you'd need the right tool to browse them that way.

One reason backup tools don't just make a copy of the database is that it's not reliably portable between different models of phone. The other will presumably be that like any SMS app they access the messages through an API rather than having direct access to the database (which is owned by a dedicated message storage app rather than any individual SMS app).

Chrome, Nest, Google home, Administrator, Android

As far as I know, no spam type text or the like could do what you describe.

However, there ARE apps that could be used to do sort of the same thing.

This requires the app to be installed on your device as well as the other persons, and it takes time to set it all up- in other words, this person would need time alone with your device.

https://f-droid.org/en/packages/tranquvis.simplesmsremote/

Filter

Back
Top Bottom