How to track the time when the phone lock is open of closed? - android

How to track how many times does user unlock his/her phone in flutter?

That is something very platform specific. Because this is a rather unusual Usecase I doubt that there is any package that offers this functionality. Therefore you will probably have to use MethodChannels and implement it with platform specific code for each platform you want to support. Here is an explanation on how to do it for android: Android - detect phone unlock event, not screen on

You can use this library for this situation: https://pub.dev/packages/is_lock_screen
With this library you can counter how many times locked and unlocked phone in flutter

Related

How to provide the functionalities/features of an android app without the user having to explicitly install it

I'm trying to provide certain functionalities for an android phone that could help people in times of emergencies. (These functionalities are dependent on the phone's sensors.) The only/main approach to achieve this seems to be that of developing an app (and I am currently in the process of developing one). But, what concerns me is that the number of people using an application specifically for emergency purposes is quite low. Even if they do install, when "Insufficient Memory" pops up, an emergency app is very likely to be booted out of the phone.
Are there other ways of providing the functionalities/features of an emergency app, without the users having to explicitly install the app? Or should I just stick with the app?
Certain OEMs provide emergency features as part of their settings. Like for example, in a Samsung phone you can toggle to enable the "Send SOS messages", and then, in case of an emergency, press the power button thrice. In what way could I achieve the same?
Any help would be much appreciated...
Thanks in advance!
Without a proper application installed in user device, you cannot provide the functionality you want.
OEM's also have their applications build and packaged with the system image. If you want it, you need to be in contact with them to include your application in new devices.

Make Phone Calls skipping dialer on Adobe AIR for Android

I am creating a android app on adobe air. I have a button in my app, clicking on which I need to call to a number skipping the dialer and once the call finishes I want the control to return to my app and record the call duration in local db. Someone please help me with code/links to the information.
Currently I am using following code to call the number which goes through the dialer,
navigateToURL(new URLRequest("tel:"+telNumber.text));
I do not believe that this is possible. The security model in both Android and iOS is pretty similar: an app cannot spy on another, peek at its data or direct execution. If you could do this, what would stop a malicious application from taking over the phone and doing bizarre things?
Once you leave your app, whether it be to jump to the browser, the maps, or the dialer, you have released control of the screen, and are now in the background with very limited execution capability.
It would be nice if the OS manufacturers opened up their systems more to have a clear API for controlling these fundamental apps. In particular the Apple dialer leaves much to be desired, but Apple bans any app that purports to be a dialer. Frankly the built-in dialers are not that clever, and it would be easy to imagine much better ones. Android is often customized by hardware vendors for this reason, and HTC, Samsung and others have their own dialers.
I don't even believe that the dialer programs agree on their data structures, so you would be on android chasing down 100 dialing programs and 100 different data formats, and for security reasons i don't think you can access the application private data.
I can imagine you would want to do what you are trying to do, but i think you are better off pursuing making your own dialer program, so you don't have to release control of the CPU to an unfriendly 3rd party program. Android won't stop you from making a dialer.
This is definitely 100% possible, I just did it (by using an ANE). Many apps have this functionality it just requires adding the correct permission on Android (to avoid security problems). Here is the ANE I used to skip the dialer and make an immediate call on Android in Adobe AIR: https://github.com/illuzor/Android-Communication-Extension-ANE (though specifically if anyone else tries using it, you must use AIR 21, using later version like 22 and beyond it did not work)

creating custom android rom

We are developing a medical android app for a hospital. However, the client asked if there is a way to prevent the users (nurses) from being able to use other functionality of the android phones except for the app we will give him. Is this is possible at all?
Thanx
Aside from rolling your own ROM, you could make your app the home screen and capture all button presses etc, hide the notification bar and generally block the rest of the device's features.
However, this would be an Android anti pattern, and I would recommend against it. Personally, I'd never work for anyone who tries to impose such strict limits on what I do.

Newbie Android Architecture query

I'm a C# Windows Phone 7 developer looking to port some apps over to Android and I'm new to both Java and android...
I have been through the Android Application Fundamentals and have developed some of the "View" app examples and have a couple questions...
1 - In WP7 we can run code in the "background" when our app is not running. The OS wakes up our background program every half hour or so so we can quickly accomplish some task. How is this done in Android?
2 - In WP7 we can post info to our "Tiles" so a user can, for instance, see the number of friends within a certain proximity just by looking at the phone. I know Android does not have "tiles" but can we post info the application icon? Or something like that?
Obviously I would have to be able to do #1 before I could do #2
Thanks,
Gary
For the first question, take a look at AlarmManager. You can set it up to periodically call up your code to do some work. You can even tell it to wake/not wake the phone from standby to do your job. So for instance if your app is updating weather info you can choose not to wake up the phone to do that (since the user wont see the update anyway) and save battery.
Second, to provide information at a glance on Android you use Widgets which the user can add to his homescreen if he wishes. You can think of them as a special kind of View.

Restore APNs when app uninstalled

AFAIK there is absolutely no way to detect the moment when app gets uninstalled.
I am currently writing an app which should among else toggle on/off 3G data. It went ok before 2.3 with ITelephony reflection calls, but from Android 2.3 this is not possible.
So I had to resort to APNDroid-style way of adding suffixes to APNs in content://telephony/carriers. This seems to work, but I stumble on the same problem as APNDroid has: since we can't detect when the app is removed, all the suffixes will remain if the user first turns off 3G with the app and then uninstalls the app.
This is an ugly and dangerous solution, because the end user may be left with all APNs broken.
It's possible to detect uninstallation from another application, but how would one force the user to install another application to just monitor the first one? It seems there is no way from 2.3 on to write a 3G-managing app.
Any ideas?
AFAIK there is absolutely no way to detect the moment when app gets uninstalled.
Correct.
I am currently writing an app which should among else toggle on/off 3G data. It went ok before 2.3 with ITelephony reflection calls, but from Android 2.3 this is not possible.
Which means that you should not be implementing the app as an SDK application. You should have not implemented the app using "ITelephony reflection calls", either.
This is an ugly and dangerous solution, because the end user may be left with all APNs broken.
Which means that you should not be implementing the app as an SDK application.
how would one force the user to install another application to just monitor the first one?
You can't.
It seems there is no way from 2.3 on to write a 3G-managing app.
Correct.
You are welcome to try to contribute changes to the AOSP Settings application, or create a new firmware application, that offers the features you seek.

Categories

Resources