I am developing an application in android for device usage profiling and analysis where I have to read features from the android OS.
For example i have to read
outgoing_calls
outgoings_calls_to_non_contacts (un-saved numbers)
outgoing_sms
outgoings_sms_to_non_contacts (un-saved numbers)
Keyboard_related readings (pressure, key_dwell_time, key_flight_time etc)
delete_key_use_rate
average_transition_left_right
average_transition_right_left
touch_screen_pressure
What will be the way to accomplish this? i.e what libraries from SDK do I have to use.
Any example for reading these values will be very helpful.
Kind Regards
Khurram
Your Application should have Broadcast Receivers. And Register Various Intents.
For Ex : Outgoing Call : android.intent.action.NEW_OUTGOING_CALL and android.intent.action.PHONE_STATE.
For Outgoing Messages : Detecting SMS incoming and outgoing
For Keyboard related I am not sure , How to do that :)
Because of security/privacy issues not all of these values are available for standard android programs. The only way I know to achieve this, is to root the device and attach yourself to the system services you need. If you only want to analyse the usage of your own application you have to write a subclass for each class which is a direct or indirect subclass of View and overwrite the onTouchEvent, onKeyPressed, onClick... events and extends these classes in your application.
Related
I've got an android phone with root and su access. I'd like to intercept all intents fired by any app and their extras bundles in my android app. Is there a way of doing that without writing a custom aosp ROM? Is it possible to change how Zygote or ActivityManager work?
I know using "adb shell dumpsys" will provide a historical view on past intents but it's missing the intent payload.
I've got a list of all the intents' action names that can be fired and added those to my androidmanfiest.xml. But some are routed to specific packages or limited behind security permissions.
Is there a one-size-fits-all approach that'll intercept all intents in Android?
Have you tried using Xposed framework? It basically allows you to intercept any method (such as Context.startService(), or any of ActivityManager's) and add your own code.
Everyone knows Tasker.
The optimal way to use Tasker would be to create a Plugin. But then you can't use other automation Apps like Llama (except you also build a plugin for them of course).
I saw a clever workaround for this. since nearly all automatisation Apps are able to start Intends, some Apps like the one for Franco.Kernel or ElementalX have classes which can be startet from such Apps to do Stuff. For ElementalX it looks like this: flar2.elementalxkernel.powersaver.DISABLE_POWERSAVE.
I like this idea and want to implement this to!
but I have some questions...
Are these just normal classes like every other Activity and Class in my Project?
How do I get my Context in those Classes?
Can those classes access all other functions and SharedPrefs in my App?
Is it possible to hand over parameters like Ints or Strings?
What else do I need to keep in mind?
The example you gave is an intent from the application ElementalX Kernel (now replaced by EX Kernel Manager)
The intent is made public by adding android:exported=“true” to the app's manifest. This means other apps like Tasker can use it.
Within the ElementalX Kernel app, there is a broadcast receiver that listens for this intent. When the intent is used, it triggers further actions. In your example, when the intent flar2.elementalxkernel.powersaver.DISABLE_POWERSAVE is broadcast, the app will receive the broadcast and call the methods that disable powersave mode.
How can an incomming Type-0 SMS (please note: "Type-0" is ment, not "Class-0") be caught by a BroadcastReceiver?
Background: For configuration purposes Type-0 SMS (with TP-PID=ME data download) are sent. This needs to be "intercepted" by an Android application and the data inside the message needs to be retrieved/ decoded.
So the intention is to READ Type-0 SMS, NOT sending it!
Is it possible with Android at all? Is perhaps a native app necessary?
Thanks and kind regards!
Consider looking into this project as they have accomplished this:
https://github.com/SecUpwN/Android-IMSI-Catcher-Detector
You can do it natively in Android. About 10 years ago, Google made silent sms really silent. So, just reverse that commit. Android Commit to silence type zero sms
In later versions of android, the corresponding files have been moved to /frameworks/opt/telephony/src/java/com/android/internal/telephony/gsm. They are SmsMessage.java and GsmInboundSmsHandler.java
Is it possible to create an Android application that automatically attend incoming calls to an Android phone? If so, which APIs may be used to achieve this (a piece of code snippet highly appreciable)?
If the programmatic auto attendant feature not possible, why the Android OS imposes this restriction?
Is iOS behaves as same as Android in this scenario, please explain.
While googling I found something that can be useful. I haven't tried yet still I think this will help have a look at Call Control in Android
You can listen incomming call intent by implementing broadcast receiver Intent.CALL_STATE_CHANGED to listen for incoming call, but answering incomming call automatically seems not feasible.coz android application dont have access to incomming call audio stream.
I'm devlopping a SIP application and whant to launch the normal incoming call interface when having an incoming call from a SIP client. Is that possible ?
Thank you very much.
I am sorry, but it looks like there is nothing as standard incoming call interface in Android (at least not until API level 10).
The screen that you see on incoming call is part of the native PhoneApp. More specifically, it is handled by the class InCallScreen.java from the dialer source code. That Activity has no Intent filters defined, so definitely it is not intended for external usage.
However, some applications may mimic native screens (or copy complete layout, not sure if license allows that), so it looks like it is from native, although in fact it is not.
I checked the source of default phone app, and I figured the only way to get this done is draw a layout exactly like the default incoming call interface -_-||
If you have the solution , please tell me , thank you so much !