I'm trying to test my iPhone and Android application with poor internet. I remember there was a program I read about a while back that would fake different types of poor internet. Does anyone remember what this program was called or if there is something similar I can use to accomplish this task?
For iOS, as others have said, use the Network Link Conditioner settings under Settings > Developer > Network Link Conditioner.
For Android, just because nobody mentioned this...
use your iOS device to set up a personal hotspot
connect your Android device to the iOS hotspot
I put the Android device into Airplane mode, and then re-enable WiFi (or turn off cellular data, but I find these settings quicker for me to access on my device)
Use the iOS device's Network Link Conditioner settings to adjust the quality of the network
Since the Android device is tunneling through the iOS device's network, it'll be effected by the iOS device's network link conditioner settings.
Super easy, super awesome, and configurable.
The one that I use and recommend is Charles Proxy. You set it up so that your iPhone or Android uses it as the proxy. Then it can throttle your connection to simulate poor network conditions like 3G.
It has a lot of other useful features like being able to track and inspect all your HTTP requests and responses which is really helpful when writing apps that access web services.
For your iOS applications, Apple has a program called Network Link Conditioner for free for Lion users as part of xCode. For your Android apps, you can probably use Netlimiter.
Netlimiter: http://www.netlimiter.com/
A strategy to fake poor internet could be to open up sockets and send data as quickly as you can - the more threads that are doing this, the more of your device's internet access will be taken up, thus leaving less for the app. For example: if you have 1 other thread sending data, your bandwidth will be halved; if you have 3 other threads, only a quarter will be left for your application, and so on...
I imagine that this is the strategy employed by the program about which you read (although there are other ways in which this could be accomplished).
There's the Apple Link Conditioner which is included with all recent installs of the developer tools. It'll be in system preferences once it's installed.
Related
I'm developing a mobile app that uses WiFi without internet connection (in order to communicate to an IOT device) and it uses cellular data as well (see TL;DR section for more).
The problem -> some devices don't automatically switch their default route to cellular (rmnet interface) while others are capable.
The workaround -> create a *"local" VPN in order to manage and re-routing network traffic via cellular interface (there are apps like Speedify that can do this by assigning priority to interfaces)
The question -> there is a simple way to accomplish this or it's pretty tricky? When I say "simple" I mean the calls of several well documented API and when I say "tricky" I mean to starting read and parse routing table with customized rules depending on every vendors?
"*local" = a VPN without web server or VPN gateway because I'm not actually interested to do the VPN's job (I seem to have understood that I need a VPN level to manage network traffic of others app but I'm pretty newbie of VPN topic)
TL;DR
My goal is to remaining connected to my access point (in order to call its APIs) AND use cellular data for all others requests I.e: login via my backend, use Google Maps and so on.
Handle this scenario it's quite easy because combining network objects, socketFactory and bindProcessToNetwork I'm able to do this.
Troubles come for others app like YouTube, WhatsApp that stop working because as default network they are using my access point without internet (Android doesn't switch default interface to a cellular)
I'm going crazy because seems that each vendor (or Android OS version?) handles "WiFi without connectivity" with cellular active in a different way.
There are certain devices that all work fine (similar to iOS) but there are others that it's a nightmare.
See this question for further details
Thanks for reading, I really love Android but those issues make me sadder every day more and I'm thinking to pass to the Dark Side of mobile development (iOS).
You've the chance to change my mind ;)
In web browser we are able to detect network call in devTool/Network, So similar to that is there anyway to detect network call made by third party apps in my android/iOS device?
I have total control over my network as well as my device. Lets imagine two cases.
1) I don't have any idea about reverse engineering the source code of an app, and just wanted to capture all network calls happened in runtime environment. Is there any possibility to use network sniffer/packet sniffer like wireshark?
2) I know ways to reverse engineering an app to certain level using libraries/tool like this and want to extract the possible network calls which may happen when I would run the app. Is there any way or someone has done it?
The motivation behind this activity is to detect network calls done by third party apps which contains payload which is not given permission(my browser cache/history/cookies etc).
Also let me know in comments if I need to add anything more in the question text.
There are various tools like wireshark and charles proxy that can help you with intercepting the calls.
Basically, for this, you would need to set up a proxy to your computer on your mobile device which will redirect all your network calls from your mobile device to your computer and then to the internet. Thus, your computer will be able to get the network call data.
Some apps have implemented SSL pinning. So when your laptop will act as a proxy in between, those network calls will fail, but I believe you will still get the data they wanted to send to the server.
I would like to make an app that allows you to block certain internet sites on Android. For instance, you set what sites to block in my app, then when you try to access that site through chrome (or another browser on Android) you are denied access.
The trend micro app can do this, as can some others, however I cannot work out how. Possible ideas I have are as follows (although I am not an android dev, not sure on feasibility):
Set up VPN / proxy that runs in-app, routing all device traffic through this. Seems like a lot of work to tunnel all traffic via your app.
Set up a DNS proxy, however that only will filter at domain level (rather than URL level) and has some other issues
Edit hosts table. Requires root access.
Is there any other way I missed? How do similar apps do this, and how would you go about it? It would be great if there was some way to hook in to network calls to accept / block / redirect traffic rather than having to tunnel all network data through my app. Thanks
I'd suggest using the app "Netguard" in this case. Although per site traffic filtering requires a pro package, I think it's worth the shot. Netguard filters trafiic quite well and also has packet capture option by default.
My app connects with a persistent connection to a server. If the device is currently using 3G it will connect over 3g.
The problem is that if it connected using 3G and moved into wifi the connection drops. How do I prevent it from disconnecting?
Sounds like the server is unable to accommodate clients seamlessly switching to a different IP address, or it may be using something like keep-alive packets to maintain connection state, and when the 3G connection drops, it disconnects your session.
This may not be something you have control over. From the Android point of view - the device will prefer WiFi depending on user preferences and you will likely not have any direct control over that either.
In a nutshell - if you can't modify or reconfigure the communications protocol to allow client IP changes on the fly, then there's nothing you can do with Android to mitigate the problem.
All mobile devices, and to a lesser extent, desktops/laptops will at some point change their public facing IP address, so it sounds like a bug or oversight in the server/protocol design to me.
EDIT:
In response to your comment, and in the interests of UX, you should be very careful about finding a way to force your app (possibly even the entire device) to remain on 3G when the user has requested that it use WiFi.
Most people have capped data plans with their device and wouldn't be very pleased if they think they are using WiFi (which is most likely free, or at least no additional cost) when in fact you've forced their device to continue using potentially very expensive 3G data instead.
This is especially important when any method would likely be actively circumventing the reasonable limits the Android environment presents you with, and therefore would probably not be flagged as a "Service that costs you money" when installed.
EDIT 2:
So, there may be a way for you to do it, but it relies on unsupported, private Android APIs which may change at any moment - usual disclaimer applies.
Take a look here where they access the ConnectivityManager object to allow you to enable mobile data.
This method does require you to build against the Android source tree, and use a shared user ID with "system" so may or may not be suitable, but these APIs are private (as apps are not supposed to be able to do this without user action), but it may help you.
This is how Android works. You're app should not maintain a persistent connection, it should only open a connection when needed.
I try to create an ad-hoc network between many Android devices, but I can't find documentation to do that.
I thought Wifi direct could work for what I want, but is it possible to have multiple connection on one device ? I saw that we could do a device acting like an access point and communicate with many devices, but can we communicate from one client device to two access point devices ?
I have for example 3 devices: A -> B -> C
The "A" device need to communicate with "C" device but he's too far away, so I want to have ad-hoc wifi direct connection between A&B and ad-hoc wifi direct connection between B&C, so A can communicate with C. It should also work with more than 3 devices.
Thanks !
Here is the link to the Wifi Direct Demo http://developer.android.com/resources/samples/WiFiDirectDemo/index.html
I have been working on establishing ad hoc communication over Android phones for a month. I am trying to create an app that could work without having 3G or access point. Main idea is to let the clients to be able transfer voice or data in a close range.
There are some guys implemented a basic system regarding almost the same topic. It basically works with Wi-Fi access point. So you need an access point in order to establish the connection. Although this is not what I am looking for, it might be helpful for others. You might need to contact them for more details.
https://sites.google.com/site/androidwalkietalkie/home
Android does not have support for ad-hoc WiFi at this time -- sorry!
Update (2019): Android has supported WiFi Direct for a while, and this answer has not been updated.
Your scenario would work. A would be able to connect with C as long as B (the group owner) is within range of both A and C.
See Android's developer documentation for more info:
https://developer.android.com/guide/topics/connectivity/wifip2p
At this time only Galaxy S 2 support Wi-Fi Direct
The wifi direct supports concurrent hosting and client capabilities on single interface. Which means, the device will act as an AP, allowing other devices to connect to it as clients, And also connect to another AP as a client. And can share internet connection by driving the internet traffic between the interfaces.
However, current implementations of wifi direct on android are specific to the phone and not part of andorid sdk. So there is not much clarity if they support concurrency. This capability is not limited by hardware.
Ad hoc wifi is disabled in Android. You need to ask Google why they have chosen to do so. If you have access to a device that allow you to install custom Android images, you will be able to patch Android to support it. Or you can root your device and reenable ad hoc Wifi, there are plenty of solutions on the web on how to enable ad hoc on rooted Android devices. This is a software issue, the hardware on every Android device that I know of has support for ad hoc Wifi.
The Serval Project, based in part on WiFi Tether, is the only place I've found this functionality. It's still alpha phase, but seems to be the forerunner in the field. The wiki is much more useful than the main project page linked above, with installation instructions and a bit of documentation.
Serval may or may not be right for your needs, but I felt it should be pointed out that ad-hoc networking is not impossible on Android. It might be better to wait until Google gets around to implementing it as standard API, though (if you believe they ever will :) ).
Well You might be interested in looking at AllJoyn. It is qualcoms SDK for android OS which includes wi-fi peer-to-peer implementations by creating adhoc connections. This is same as Wi-Fi Direct.