Android data usage control / tracking? - android

Our company giving out Android devices to drivers. Our application should never use more then 1Gb by nature of communications we do.
However, some drivers managed to use about 10Gb of data :)
So, I wonder:
Is there any way to track data usage of our app vs other apps so we can notify users and office workers?
Is there any way to DISABLE data access from any app other then ours?

Take a look at TrafficStats, with help of that you can get the amount of data sent/received. And you can get the data by UIDs to see where it was used.

Is there any way to DISABLE data access from any app other then ours?
If rooting the devices is an option then you can use the free Application DroidWall This application makes use of the iptables rules of linux to let you allow / disallow applications from using network data.

Is there any way to track data usage of our app vs other apps so we can notify users and office workers?
As H9kDroid indicates, use TrafficStats. Here is a sample application that takes an initial snapshot of the consumed bandwidth, then takes another one when you tap a button, displaying the overall difference on-screen and the per-UID difference in LogCat. Note that not all devices support the per-UID stuff (e.g., not the Ice Cream Sandwich emulator).
Is there any way to DISABLE data access from any app other then ours?
No, sorry. Eventually, the combination of device admin rules and the new traffic management stuff in Ice Cream Sandwich's Settings app might allow for this, but not presently. Or, you could create custom firmware.

Related

Fetch usage of other apps from my application in Device Admin mode

I have an Android app for which I wanted in COSU mode. I have successfully activated my device into Device Administrator mode.
Now I want the data of the usage of other apps used daily. For eg: Facebook, etc. I need the data to monitor usage of other apps. How can I achieve this programmatically?
TIA.
Not 100% sure what you are looking for, but do you mean something like UsageStatsManager
(documentation)?
Using Android library class TrafficStats, you can find how much bytes received/sent across mobile networks since the last boot.
Also, you can find how much of bytes transmitted/received by the given UID since device boot. and you can find any package UID with RunningAppProcessInfo.
Here is a detailed answer on this here and an article on Creating a network monitor

Get certain information from Android Auto

I'm starting to research about Android Auto, I want to do my thesis on this.
I want to know if it is possible to obtain from the Android Auto certain information that is important for the thesis project, such as:
bluetooth connections,
phone connections (identifiers, contacts, call logs, SMS),
mass storage devices,
and navigation infomation.
It is a project whose objective is to help researchers obtain important information in court cases.
I will be very grateful any information you can provide to me.
Android Auto is really just another app, but enables a projected experience of the Android system to an Auto supported vehicle dashboard. Architecturally, what 3rd parties are allowed to build on is just a shell/template. The real activities etc are in the Android Auto process, and connected to the car.
When a 3rd party app is being shown, Android Auto just shuttles methods (onCreate, onResume, etc) back and forth between the processes. The information you’re asking about when used while Auto is connected would still be found through the mobile device and not independently within the Android Auto app itself.

Using data in data saver mode on Android-N

I have a question about data saver mode on Android N version.
If users use network data on a specific application about carrier service, it won't be charged costs of data even though connected on cellular data network.
Because carrier have not charged on their applications that provide information about using one's services.
But devices using data saver mode will be restricted for using applications or widgets though network is free.
Is there any way to avoid on data restriction except setting in a white list? or to let system know that it is free network on specific app, so don't restrict network communicate on this app?
Do applications have to be compiled with android N version?
Is there any way to avoid on data restriction except setting in a white list?
For pre-installed apps, it is possible that a device manufacturer might add apps to the whitelist based upon particular carrier agreements. However, since the carrier can change the billing rules whenever the carrier wants, this would not be a good idea.
or to let system know that it is free network on specific app, so don't restrict network communicate on this app?
No, because then every developer would do that.
Do applications have to be compiled with android N version?
The behavior of Data Saver has nothing to do with your compileSdkVersion or (AFAIK) your targetSdkVersion. If you want to work with the APIs to find out the Data Saver status, that would require a compileSdkVersion compatible with Android N.

Building a native app to uniquely identify, track and lock a smartphone handset

I'm currently doing some research about my project, a smartphone tracking native application, and I have four questions. Links to any material I can read up will be greatly appreciated, and the most useful/comprehensive response will be accepted.
The primary target smartphones are the Android, Blackberry and iPhone models.
For starters I found out here Uniquely Identify an Android Handset that IMEI can be used to uniquely identify Androids but I think I once read that it can be faked. I don't know about the iPhone and Blackberry.
What's the most reliable way to uniquely identify the smartphone device, if any? Can MAC addresses work or is it possible to spoof that? Can IMEIs truly be faked?
Is it possible to "lock" the device with a custom error message remotely via its unique identification, once the device is reported as stolen? This lock state will remain on the phone even when disconnected from the network, until it is reconnected to the network and unlocked remotely once again.
Assuming such a remote phone lock is possible, can such be reversible by the thief? The native app will run in stealth mode so that it cannot be uninstalled.
Can a cross-platform solution work in this case, or will I have to develop various native apps per platform?
EDIT:
Some more context. As Till rightly said, Apple's "Find my Phone" does this exact thing already (I am just finding out about it, but it looks like a perfect fit already). The user who is choosing to install the app is informed that the phone will be uniquely identified if they do install the app. As for locking the device, "Find my Phone" does it (I gather). Now I need to know how that might be possible on the two other platforms.
With regards the iPhone side of things:
You aren't allowed to uniquely identify the iPhone like that. Apple have just forbidden it unless you get the user's permission first. So if they refuse you permission, your app won't function and you'll need to find another way.
No, you can't do that.
See 2. Also you can't run an app in "stealth mode"
See 2.
Only the network operators can talk to the handsets on an IMEI level. The IMEI number IS the MAC address of GSM networks. However, you can't access that unless you have control of the network. Sure you can get the IMEI from the user, but you can't use that to locate the phone. On CDMA networks this address is called the MEID number.
But there are other ways:
You can get location data on either platform with the users' permission. This is the way you should think about developing your application. You'll want to assign a UUID to a user once they download and install your application on their phones. You can then have the phones report to a server every so often (heartbeat). As long as the phone is powered on and connected to a network, the user would be able to locate the phone.
You can also get the phones IP address on the network, among other things -- such as contacts, messages, files, cache data etc..
On Android it's pretty easy to implement this kind of functionality as a service that could would only be visible on the packages page. Further, if you have root access, you can write whatever kind of rootkit you want such that it hides itself from the system. Same with a jailbroken iPhone. I am not as knowledgeabe about iPhone services though.
Either way, the only cross platform compatibility you'd be able to exploit would be perhaps the way data is sent and received from the server. You could use some standard such as JSON to send and receive data (and hence the same server). Although, both platforms have JSON and Apache libraries, the other parts of the apps or services themselves will need to be completely and dependently developed for each platform (UI, Internal Content Handeling, Syscalls, Permissions, etc).
You can remotely lock, wipe, factory reset, etc. Android devices using the security and device administration Android system interface. This still requires the user to grant permission and it asks them an a more.. obnoxious.. way so that they know what exactly they are agreeing to when they give an app device administration permission. If you ever use an exchange server for business or school, it's likely you'll run into this.
I am unsure about remote iPhone device administration on a jailed system.
If you really want something that can't be removed lest you do a factory reset, you'll need to know a thing or two about Unix programming, and a lot about the operating systems that their respective SDK's don't (and probably shouldn't) tell you. You'll need to be comfortable poking around sources and even reverse engineering if called for. If you're still interested, you'll want to hang around the circles that work on custom phone firmware and software for the iPhone, and Android (and Blackberry). I would start with Android. It's probably the easiest since the sources for the AOSP are easily and legally available.

Mobile Devices Architecture - iOS, Android, WP7 and Disconnected Instances

I am seeking some architecture advice within the mobile space. I am wondering what people are today within their applications, say for the iOS, Android, WP7 devices, in terms of web services and instances for caching data when disconnected?
Many of our applications need to work offline due to having limited connectivity, so data storage/caching, synchronization, etc. is critical.
Any and all advice will be greatly appreciated.
If your apps need to work in a limited connectivity enviornment just store everything you need in a database, and have a synchronize option so the user can decide when he has connectivity to update everything or send data back to the server.
Another option would be to have the app monitor for connectivity, and when it is being used and a network is available have it automatically work in online mode and when no network is available in offline mode.
Depending on the level of "limited connectivity" I would just go for the full offline option and let the user synchronize. I develop apps that are used in many remote areas of south america and the full offline option is just better. I used to have issues with intermitent connectivity in border areas where the network would jump between available and unavailable and it made a mess in data transmition.
I can't speak for iOS and Android, but for my WP7 app I store data offline in isolated storage. My app essentially works in disconnected mode so everything is stored offline and at certain events e.g. saving a task the app checks to see if it has a mobile connection and if so synchronizes with the back-end.

Categories

Resources