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

Fetch User Location when the App is closed and Handle doze mode.

I have a usecase when I need to fetch user location for every 5 min say (this is configurable but not less than 5 min). I have tried the following:

1) Alarm manager and setting it to Periodic , thereby raising a broadcast from which triggering a Foreground service and holding a partial wake lock to fetch location and send to server.

2) next Approach was using the work manager API to do all this process. but this deferred the task a lot and in MI mobile the task totally terminated when the app is removed from the App tray.

3) Used oneshot alarms by setting the time manually and triggering next alarm in the broadcast. It also got deferred.

What should i do to solve this issue. Tried even with Removing Battery Optimization.

Samsung Galaxy Fold released September 6th

Will be interesting to see if they were able to fix the Galaxy Fold.

From https://news.samsung.com/global/samsung-galaxy-fold-now-available
Samsung Electronics today announced the launch of the Galaxy Fold—a completely new category of mobile technology—available in Korea on September 6, followed by select countries including France, Germany, Singapore, U.K., U.S., and more, in Cosmos Black and Space Silver. With a 5G-ready option in select countries, consumers will be able to unfold the future on the fastest network speeds available.

During the past several months, Samsung has been refining the Galaxy Fold to ensure it delivers the best possible experience. Not only we improved the Galaxy Fold’s design and construction, but also took the time to rethink the entire consumer journey.

ARcore - is it possible to make AR APP using powerful phone that is not listed in google officially

Hi guys


I have a question related to google ARcore supported Phones.

I have a Xiaomi K20 pro phone that has powerful specs to handle ARcore but it isn’t listed in google “ARCore supported devices” list.


I want to know, is there anyone here who has experience with developing a AR APP with ARcore with Xiaomi K20 pro (or any other powerful phone that doesn’t listed in the ARcore supported device list)

and is it possible to do that or not?


PS, Xiaomi k20 pro specs are exactly the same as Xiaomi Mi9 ( Mi9 is supported but K20 isn't )


Cheers.

How to display count of unread notifications on app launcher icon like Facebook/WhatsApp

I want to show count of unread notifications on my app's launcher icon when the app in not opened. I saw some posts similar to this which suggests to use some 3rd party libraries to achieve this.

But when I checked the libraries, it does not seem to support all the devices.

Any idea on a generic solution which will work on all possible devices (with or without 3rd party libraries)?

Any help will be much appreciated.

Thanks

Spinner not getting populated with database records in android

Hi. I am using Yii2 REST API. I have a table called studentrecords consisting of Id,FirstName,LastName, Class fields. I have a API which returns the json array containing stiudent FirstName and LastName. API is working fine. Now I have a android code where I use a spinner to display student names from the database.
Java:
package com.example.anitaa.studentapplication;

import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.widget.ArrayAdapter;
import android.widget.Spinner;

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

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

public class UpdateActivity extends AppCompatActivity {
    Spinner spinner;
    ArrayAdapter adapter1;
    String url1 = "http://192.168.1.6/student/web/studentrecords/studentnames";

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate ( savedInstanceState );
        setContentView ( R.layout.activity_update );
        spinner = (Spinner) findViewById ( R.id.spinner1 );
        final List<String> list = new ArrayList<String> ();

        try {
            JSONArray jsonarray=new JSONArray(url1);
            for(int i=0;i<jsonarray.length();i++)
            {

                JSONObject jsonObject = jsonarray.getJSONObject ( i );
                list.add(jsonObject.getString ( "FirstName"));
                list.add( jsonObject.getString ("LastName"));
            }
        } catch (JSONException e) {
            e.printStackTrace ();
        }

        adapter1=new ArrayAdapter ( this,android.R.layout.simple_spinner_item,list );
       // adapter1.setDropDownViewResource ( android.R.layout.simple_spinner_dropdown_item );
        spinner.setAdapter ( adapter1 );



    }
}

When I run it then spinner is not populated witth records. How to do?

Supports-Screens

Hey I have been learning about developing games for Andriod and I just wanted check some information becuase it's not 100% clear.

Firstly the bellow two links from the Andriod Developer website both show declaring support in a different way.

The first one:

https://developer.android.com/guide/topics/manifest/supports-screens-element.html#compat-mode

Code:
<supports-screens android:resizeable=["true"| "false"]
                  android:smallScreens=["true" | "false"]
                  android:normalScreens=["true" | "false"]
                  android:largeScreens=["true" | "false"]
                  android:xlargeScreens=["true" | "false"]
                  android:anyDensity=["true" | "false"]
                  android:requiresSmallestWidthDp="integer"
                  android:compatibleWidthLimitDp="integer"
                  android:largestWidthLimitDp="integer"/>

The second one:

https://developer.android.com/guide/topics/manifest/compatible-screens-element#screenSize

Code:
<compatible-screens>
        <!-- all small size screens -->
        <screen android:screenSize="small" android:screenDensity="ldpi" />
        <screen android:screenSize="small" android:screenDensity="mdpi" />
        <screen android:screenSize="small" android:screenDensity="hdpi" />
        <screen android:screenSize="small" android:screenDensity="xhdpi" />
        <screen android:screenSize="small" android:screenDensity="xxhdpi" />
        <screen android:screenSize="small" android:screenDensity="xxxhdpi" />
        <!-- all normal size screens -->
        <screen android:screenSize="normal" android:screenDensity="ldpi" />
        <screen android:screenSize="normal" android:screenDensity="mdpi" />
        <screen android:screenSize="normal" android:screenDensity="hdpi" />
        <screen android:screenSize="normal" android:screenDensity="xhdpi" />
        <screen android:screenSize="normal" android:screenDensity="xxhdpi" />
        <screen android:screenSize="normal" android:screenDensity="xxxhdpi" />
    </compatible-screens>

Is there any real difference between the two other than that the first dose not specify density?

Second I wanted to just make sure I understand what exactly constitutes as a Small, Normal, Large and xLarge screen.

Please correct me on this:
A Normal screen is a HVGA 480x320 pixels screen. This value is the baseline for that other screen sizes.

A Large screen would be 1.5x the normal baseline.

A XLarge screen would be 2x that baseline.

and so on...

Help Airplane mode issues

got a strange issue and was wondering if anyone else is facing it. I am unable to turn off or on flight mode on the phone. When i try to turn it on the icon on the top shows flight mode but im still able to make calls and use the internet even thought flight mode is on. If i restart the phone it applies right away. Same goes for the opposite way if i turn off flight mode I cant make any calls and the network portion of the phone shows a white cancel sign to say no network, again only thing that would fix it is restart the phone. Spoke to samsung chat they made me reset the app settings and try safe mode both of which didnt help.

Looking for music player. Frustrated. No hope?

I'm looking for an MP3 player, and I'm getting totally frustrated.

There are literally dozens of players for Android. They all seem like clones of each other: all have the same 5-channel equalizer, playlist functionality, and all other UI features. Can anyone point me to a truly unique player?

I'm a simple, old-fashioned guy. My favourite player on Windows is WinAmp. I don't care for streaming, album covers, automatic download of lyrics, file sharing, or playlists. By God, I've never in my life used a playlist. What are they for? I want to get into my car and simply listen to a whole Metallica album for 50 minutes, uninterrupted. Who uses playlists? I would really appreciate if you could enlighten me in the comments about what playlists are good for.

I hate it that all players use by default the metadata (tag) of my MP3s. Since most of mine don't have tags, what I'm getting is a huge list of albums by "Unknown", filled with tracks that are all called "Unknown". This is insane. On Windows I simply use Windows Explorer. Each of my MP3s has a file name, and they are all organized in named folders. Done.

I find that most apps give me a hard time trying to find my files on my phone. The default is always those silly playlists. Then you can choose based on artist ("Unknown"), album, track... But I'm simply asking for a file-manager-type interface that will allow me to browse my folders and choose my albums from there. Too much to ask?

Everyone recommends VLC, but I find its interface inferior. If I listen to my Metallica album and pause, then the album won't continue to play continuously afterwards. I need to tap on each track individually while driving. Unacceptable. Why can't the songs just continue to play after each other? Is this such a programming challenge?

Also, in order to pause in VLC, or in most other players, I need to tap, while driving, on a 16x16 pixel pause button. Really? Can't there be any app that allows me to press anywhere on the screen to pause? What's more basic than this? The same goes for skipping a song. Tiny, inconspicuous button for the most basic of actions.

In addition, I always need to navigate to my music folder on my phone, which is on my external SD card. VLC refuses to remember that it's there and to point there by default.

So, dear people: is there any 90s-style player out there for me that would simply play music without all the fluff?

Play Store app "flashing" blank screen

My Google Play Store app is not opening instead the screen "flashes" quickly and appears to slide left over and over. Happened in last week. Have tried all tips such as clear cache, clear data, reset, uninstall & reinstall, app permissions...nothing works. Please help! Verizon store tells me its a virus and wants to sell me a new phone, but I don't believe them. Thanks.

Unable to read SIM data on Samsung A50

Just purchased a new Samsung Galaxy A50.
No issues with the phone other then listed below.
It is a dual SIM phone. With SIM 1 - AT&T, SIM 2 - SaskTel.
I cannot get any SIM Data to read. My old phone (Samsung Galaxy S8) can read both SIMs perfectly fine. So the problem doesn't appear to be the SIM cards themselves.

The phone is completely functional otherwise (can place calls, text, browse, or write on this forum)


What I am trying to accomplish is migrating RoboKiller to my A50. It gives an error (see image) and I cant get it to function.

What I have tried:
Turned off data
Turned off SIM 2 (and vise versa)
Restart
Cleared SIM data (in settings)
Used 3G Mobile network
With or without WiFi (even turned off)

Is there anything I am missing?

Attachments

  • Screenshot_20190904-194546_Phone.jpg
    Screenshot_20190904-194546_Phone.jpg
    88.4 KB · Views: 211
  • Screenshot_20190904-223704_Phone.jpg
    Screenshot_20190904-223704_Phone.jpg
    88.9 KB · Views: 151

Help Android 10 Exchange Email Issue - "Security Update Required" - Please Help

PROBLEM
  • Just installed Android 10 on Pixel 3 XL
  • Gmail app for my Exchange email account is notifying me: "Security Update Required"
  • Clicking the notification opens the Gmail app and gives me a prompt to "Update Now"
  • Clicking "Update now" on the prompt crashes the app and brings back the notification referenced above
  • Not sure if related but I've noticed Gmail is no longer listed as a "Device Admin"
WHAT I'VE TRIED
  • Different combinations of deleting account, deleting and reinstalling Gmail updates, clearing data/cache

Apps Android screen recording portion of app

I am creating a feature in an app in which the user can record their screen. So far, I've been semi-successful.

As a first pass, I tried recording screenshots then encoding them using JCodec. This worked, but the encoding was extremely slow on Android which made it unfeasible.

A second attempt was to use MediaRecorder but this records the whole screen, including the Android UI. The results are ugly and I haven't found a way to record only a portion of the screen using MediaRecorder.

So I'm looking for any alternative solutions or possibly a library that can crop video that isn't slow to process like JCodec. Any ideas?

Geography. Quiz. Many tests

Install the application &#8220;Geography. Quiz. Many tests&#8221; - this is an entertaining game where you need to answer questions, guess the right answers, gain new knowledge and learn interesting facts!

Geography. Quiz. Many tests:

&#10004;&#65039; A free, smart app to test your knowledge of geography!
&#10004;&#65039; More than 2000 questions!
&#10004;&#65039; Simple and intelligible interface!
&#10004;&#65039; Questions include all geography topics!
&#10004;&#65039; Ability to choose the topic you are interested in!
&#10004;&#65039; A great way to relax and exercise your memory!
&#10004;&#65039; Interesting facts on the topic of our planet and geography!

You can study geography or prepare for the exam and assess your level of
knowledge of geography.

The questions presented in the game cover all topics and key areas of
geography.

Here you have to guess which state is located on the map, which state the flag belongs to and answer fascinating questions about the countries and states of the world.

How to play:

- Press the 'START' button and select a geography category you are interested in!
- Each topic has its own levels. Levels open when you pass and score points!
- Get points and coins for every correctly answered question!
- Points give you the opportunity to go to the next level!
- Coins give you the opportunity to use the tips when passing the quiz!

Tips:

At the bottom of each question there are 4 tips that can increase your chances of a correct answer.

&#10004;&#65039; &#8220;50:50&#8221; - use this hint if you want to exclude 2 incorrect answers to the question.
&#10004;&#65039; &#8220;Skip question&#8221; - activate this hint to get through without minus points.
&#10004;&#65039; &#8220;Audience survey&#8221; - use the audience to check, other users choose the answer option.
&#10004;&#65039; &#8220;Reset Timer&#8221; - resets the time if you need to think more!

In this quiz you will find questions from the following categories:
* Flags of the world
* Capitals of the world
* Country by contour
* World countries on the map
* Lithosphere, hydrosphere, atmosphere
* Geographical Discoveries
* Tests on the continents (North and South America, Europe, Africa, Australia, Asia, Antarctica)
* Country Population
* Currencies
* Sights
And also a lot of interesting facts about the world!

' Geography. Quiz. Many tests' - a quiz for those who want to study geography.
Have fun and you will have the opportunity to improve your general knowledge and memory!

https://play.google.com/store/apps/details?id=top.excellenceapp.engeography

Help Screen goes to sleep after 5 seconds

I have [Settings -> Display -> Advanced -> Sleep] set to 30 minutes, but my phone goes to sleep after 5 seconds even when I'm looking at it. Any ideas?

Edit: This has been happening for a long time now and I'm pretty sure it has something to do with the Attentive Display not working properly.

Problem 1: The Attentive Display overrides whatever your sleep setting and/or puts the phone to sleep manually after 5 seconds.
Problem 2: If you turn off the Attentive Display, it does not stop overriding whatever your sleep setting is and changing the sleep setting doesn't have any effect.
Problem 3: The Attentive Display's facial recognition is not very good to begin with
Problem 4: The phone's camera is not very good, making it hard for the facial recognition to be any good.

Notifications

I have an S9 and a Tab4. I don't use the Tab nearly as often as the phone. So each time I turn the Tab on, it 'catches up' on notifications that have happened since the last time I used it. Problem is that I have already seen these on the S9, which I keep on and with me 24/7. This really slows down the processor, etc. and inhibits updating apps, or whatever else I may be doing on the Tab.

Is there a way to disable this? If so, do I do it on the Tab or is it an Anroid issue? Thanks.

ClarinetHero
gregbaker112@gmail.com

Passing a custom object to BroadcastReceiver results via intent returns null

I'm trying to pass a custom data class object from a foreground service to a BroadcastReceiver. I have tried using Parcelable, Parcelize and Serializable, but the BroadcastReceiver intent always reports it as null.

I have wasted a couple of days searching for an answer and have looked at some of the threads here and elsewhere. The accepted answers that work for others are not working for me.

Here's the service:
Code:
class MyService : Service(){

............
<Some code that initialises alarmTimeInMillis>
............

   private fun sendDataToReceiver(){
      val intentMyRcvr : Intent = Intent("Data", null, this, MyReceiver::class.java)
      intentMyRcvr.addFlags(Intent.FLAG_RECEIVER_FOREGROUND)
      val bundle = Bundle()
      val myParcel = MyParcel(dataP.Id, dataP.Location, dataP.Title, dataP.Description, dataP.Type)
      bundle.putParcelable("MyParcel", MyParcel)
      intentMyRcvr.putExtras(bundle)
      val pendingIntentMyRcvr= PendingIntent.getBroadcast(this, dataP.Id, intentMyRcvr, PendingIntent.FLAG_UPDATE_CURRENT)
      val alarmManager = getSystemService(Context.ALARM_SERVICE) as AlarmManager
      alarmManager.setWindow(AlarmManager.RTC_WAKEUP, alarmTimeInMillis, 5 * 60 * 1000, pendingIntentMyRcvr)
   }
}

Here's the BroadcastReceiver:

Code:
class MyRcvr : BroadcastReceiver() {

   override fun onReceive(context: Context, intent: Intent) {
       if (intent.action == "Data") {
           val bundle = intent.getBundleExtra("MyParcel")
           val myParcel = bundle.getParcelable<MyParcel>("MyParcel")

           val intentToService = Intent("Data", null, context, MyService::class.java)
           if (myParcel != null) {
               intentToService.putExtra("MyParcel", MyParcel)
               context.startService(intentToService)
           }
       }
   }
}

Here's the Parcelize data class:

Code:
@Parcelize
data class MyParcel(
   var Id: Int = 0,
   var Location: String,
   var Title: String,
   var Description: String,
   var Type: String,
) : Parcelable

I've also tried without using Bundle i.e. directly passing the parcelable object. Neither produces any error in the service but, the the rceiver always reports it as null. I have included the stack trace from logcat:
Code:
4081-4081/a.b.c E/AndroidRuntime: FATAL EXCEPTION: main Process: a.b.c, PID: 4081 
java.lang.RuntimeException: Unable to start receiver a.b.c.AlarmsRcvr: 
java.lang.NullPointerException: Attempt to invoke virtual method 'android.os.Parcelable 
android.os.Bundle.getParcelable(java.lang.String)' on a null object reference at 
android.app.ActivityThread.handleReceiver(ActivityThread.java:3389) at 
android.app.ActivityThread.access$1200(ActivityThread.java:200) at 
android.app.ActivityThread$H.handleMessage(ActivityThread.java:1662) at 
android.os.Handler.dispatchMessage(Handler.java:106) at android.os.Looper.loop(Looper.java:193) 
at android.app.ActivityThread.main(ActivityThread.java:6680) at 
java.lang.reflect.Method.invoke(Native Method) at 
com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493) at 
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858) Caused by: 
java.lang.NullPointerException: Attempt to invoke virtual method 'android.os.Parcelable 
android.os.Bundle.getParcelable(java.lang.String)' on a null object reference at 
a.b.c.MyRcvr.onReceive(MyRcvr.kt:21) at 
android.app.ActivityThread.handleReceiver(ActivityThread.java:3380) at 
android.app.ActivityThread.access$1200(ActivityThread.java:200)  at 
android.app.ActivityThread$H.handleMessage(ActivityThread.java:1662)  at 
android.os.Handler.dispatchMessage(Handler.java:106)  at android.os.Looper.loop(Looper.java:193)  
at android.app.ActivityThread.main(ActivityThread.java:6680)  at 
java.lang.reflect.Method.invoke(Native Method)  at 
com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)  at 
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)

I am beginning to wonder if it is a bug in the latest SDK or Kotlin Plugin. Any ideas what I might be doing wrong ?

Cracked screen, filed Asurion insurance claim for $29. UBreakIfix won't fix it.....

So my wifes Note 8 has some cracking in the glass on the front screen. Basic repair. I have done tons of screen replacements on older Samsung galaxy phones and it is very basic repair work. The note 8 has the glass backing so I dont want to mess with it so I filed the $29 claim with Asurion (I have verizon) and I take it to uBreakIfix to get repaired. 2 hours later they call me and said they "cant complete the repair because the fingerprint sensor on the back doesnt work." & "based off Samsungs stringent testing requirements we cant replace the front screen if the fingerprint sensor doesnt work and the fingerprint sensor isnt covered by Asurion"

I replied with "okay but I dont care about the fingerprint sensor. That's why my claim was for the front screen only. I dont care what Samsungs "stringent testing requirements are" It's my phone and I don't give a shit about the fingerprint sensor just fix the part that is covered by my insurance"

They wouldnt do it.

Now what do I do?????? Do I have any other options? This is a joke.

uBreakIFix just doesnt want to do the work because since they cant fix the fingerprint sensor, they cant make money off me by only completing the work covered by insurance.

Only setting speaker volume

I've been on a quest for a long time to set volumes based on location, like at home I want certain volumes set and at work I want my phone on vibrate. I've been surprised how hard it is to get it to work right when you throw bluetooth and headphones into the mix (mostly the bluetooth).

I'd like to set speaker volume when I enter or leave these locations but not affect bluetooth volume. So I track when bluetooth is connected but getting it to work right is still elusive. I think it boils down to timing, order of when things happen, differences in when bluetooth reports as being connected vs. when the volume setting applies to bluetooth.

Is there any way to ignore whether bluetooth or headphones are active and instead just say "I want the speaker volume to be X" so that once bluetooth deactivates or headphones unplug, the speaker volume is already at the desired level? In other words, would it be possible to have tasker somehow tell android to set the speaker volume rather than generically the media volume? (possible feature request?)

Any other way to approach this problem that isn't so fraught with complexity?

Android 10 - problem with fingerprint unlock

HI,
After I upgraded to Android 10 the fingerprint unlock feature stops working from time to time. The fix is too reboot the phone. The fingerprint still works on apps and if I go to fingerprint setup it detects my fingerprint. At the same time it doesn't even recognize my finger swiped when I try to unlock the phone. Thus it isn't the sensor. I deleted my fingerprints and re-saved them. No change. I don't see anything action that is causing this. Any ideas? Anyone else having this issue?

Cannot transfer apps to the SD Card

)I need to transfer as many apps as possible to the SD card which is only 4% used, but none of the utilities which are supposed to do this ---- such as Apps2SD, and especially Link2SD. The latter works fine on my Samsung Tablet but not at all on my Redmi Note 7. No apps identified as 'movable' are listed. I like Link2SD, but have tried others some of which ask me to 'select' SD card and I am not sure if I am doing that right (instructions flash on and off too fast to read); and others ask me to root the phone. The only thing I know about rooting is not to go near it. Is root required for Link2SD to work? I tried asking the Developer but go no reply.

Filter

Back
Top Bottom