Android: detect when app finishes installation - android

I want to detect when an application in android has finished installation without using a brodcast receiver. Is this possible?

you might be able to read logs instead , but that requires "bad" permission , which is no longer supported as of API 16 (jelly bean) .

Related

What happens in Android if you run code that requires a permission but fail to have it?

I am talking about the quality issue (bug) that an Android app needs a permission that is declared in the Manifest, but fails to request it from the user at the appropriate time and executes the code without the necessary permission. This was not possible in older Android versions (user accepts all permissions in bulk), but seems to be possible when using newer versions that copy Apple in most regards.
At least during testing one can start background services and use bluetooth without any alert by Google popping up. Is that different for apps in production?
Does the app crash with an Exception?
Does the code get executed?
Does the app get rejected in review? (Always?)
Does the app get delisted from the store?
Does it depend on Android's Version?
I deal with an age old app that has bluetooth discovery code to find and connect to dedicated hardware, that is rarely used via a cordova plugin triggered by content. There is old altbeacon code potentially activated that may even need access background location (https://developer.android.com/guide/topics/connectivity/bluetooth#Permissions). It will take some time to get this dead code up to quality. Definitely more time than the week we have.
Does the app crash with an Exception?
yes if you try to have operations depends on returned date witch is null
Does the code get executed?
code will execute with exceptions because data access denied you can check if permission granted or not and add scenario for each state
Does the app get rejected in review? (Always?) not sure but with crashes there is high potential to get rejected
Does the app get delisted from the store?
depends on why and how you are using data
Does it depend on Android's Version?
yes access data and permissions changing point is android oreo
My tests with Bluetooth permissions revealed the following: Required permissions are BLUETOOTH_ADMIN, BLUETOOTH and for VERSION_CODES.Q additionally Manifest.permission.ACCESS_BACKGROUND_LOCATION (see: https://developer.android.com/guide/topics/connectivity/bluetooth#Permissions).
BLUETOOTH_ADMIN, BLUETOOTH do not show any system alert-dialogue to the user. In Android Q+ if you fail to check for the required ACCESS_BACKGROUND_LOCATION permission, nothing happens and your code executes without exception (mine did execute an UART command on hardware with Samsung tablet). The app passed review although the check is missing (of course I will fix that ASAP).
Note: the doc is ambiguous and states: "Services running on Android 10 and higher cannot discover Bluetooth devices unless they have the ACCESS_BACKGROUND_LOCATION permission." Probably general scanning while the app is active could be allowed. In that case missing exception would be explained.

STEP_COUNTER and STEP_DETECTOR works with SDK 28, but not SDK 29?

I've made a service that regularly broadcasts counted steps from both the STEP_COUNTER and STEP_DETECTOR sensor. In one app I made it worked flawlessly, but after copying the exact same code to another project it stopped working. After hours of debugging, I figured out how to solve it. When I change the compileSdkVersion in the build.gradle to 28 it works fine, but changing it to 29 makes it stop working. Why is that?
As per the Privacy changes in Android 10 (which apply to apps that have a targetSdkVersion of 29 or higher):
Android 10 introduces the android.permission.ACTIVITY_RECOGNITION runtime permission for apps that need to detect the user's step count or classify the user's physical activity, such as walking, biking, or moving in a vehicle. This is designed to give users visibility of how device sensor data is used in Settings.
The only built-in sensors on the device that require you to declare this permission are the step counter and step detector sensors.
Therefore you must:
Add the android.permission.ACTIVITY_RECOGNITION to your app's manifest.
Request the permission at runtime and have the user grant that permission.

Android Boot Completed Receiver doesn't work on system app

My application contains a BOOT_COMPLETED receiver like described in other threads here. It works perfectly until I changed my app into a system application. Now the Receiver does not trigger the event anymore.
Any ideas for this issue? I'm using Android Kitkat 4.4.2 on a Radxa Rock Pro. Compiled my own image to register the app as system application.
we need more detail to help you, post the code and the manifest, also debug log, in other hand you must use Log.i(TAG, "onReceive."); to know if the problem is in onReceive() or when trying to run the service class.

Receive SMS in Android 2.3 vs Android 4.0

I have written an SMS app to receive SMSes using the various samples available online. I tested it in a Android 2.3 device and it was working perfectly.
Now, I changed the API level to Android 4.0 and tried running it on an Android 4.0 device and nothing happens. I checked the logcat in Eclipse and nothing is displayed there too.
Any idea what needs to be done for it to work?
Check Once Again that you are actually creating and registering the
broadcast receiver in an Activity otherwise it will not get called
as after Android 3.1 it requires apps to be in started state to
receive broadcasts.

Android Listen to Installation Notification

Google show in the notification menu percents of installation process. Does it possible to listen to it. I want f.e. receive the begining of installation process and the ending. I know that ending can be received with android.intent.action.PACKAGE_ADDED . But how can I get information about starting of installation or is some apps downloaded in this time from play store?
Does it possible to listen to it.
No. You cannot spy on other applications' Notifications.
But how can I get information about starting of installation or is some apps downloaded in this time from play store?
You modify the firmware to add this capability and install this firmware on your own device.
this might be possible on API 18 (android 4.3 jelly bean) :
http://developer.android.com/reference/android/service/notification/NotificationListenerService.html
http://developer.android.com/about/versions/jelly-bean.html#43-beautiful-apps
http://developer.android.com/about/versions/android-4.3.html#NotificationListener
http://android-developers.blogspot.co.il/2013/07/android-43-and-updated-developer-tools.html?utm_source=feedburner&utm_medium=feed&utm_campaign=Feed%3a%20blogspot/hsDu%20%28Android%20Developers%20Blog%29

Categories

Resources