android-internet

Simulate Slow Internet Connection on a REAL device? [duplicate]

﹥>﹥吖頭↗ 提交于 2019-12-03 12:14:55
This question already has answers here : Simulate low bandwidth in android (11 answers) I need to test my application in conditions where even 2G Internet connectivity isn't at its full coverage (i.e. 2 bars instead of 4, 2G). I prefer conducting these tests over WiFi. Is there a way (programmatically or otherwise) to tell the Android OS on the real device to slow down or throttle Internet connection 56 Kbit/s? Note: I know how to do this on the emulator . I'm looking for a way to do this on a real device . Is this possible? In one of your comments you mentioned that you have a DD-WRT router,

ConnectivityManager.EXTRA_NO_CONNECTIVITY is always false on Android Lollipop

偶尔善良 提交于 2019-12-03 07:31:50
I am using this piece of code to detect Internet connection state changes. It works fine on Android<5.0, but on API 21 this: intent.getExtras().getBoolean(ConnectivityManager.EXTRA_NO_CONNECTIVITY) is always false. How to make this code to work on Android 5.0? My BroadcastReceiver: public class NetworkStateReceiver extends BroadcastReceiver { @Override public void onReceive(final Context context, final Intent intent) { if(intent.getExtras()!=null) { final ConnectivityManager connectivityManager = (ConnectivityManager)context.getSystemService(Context.CONNECTIVITY_SERVICE); final NetworkInfo

How MediaCodec finds the codec inside the framework in Android?

拜拜、爱过 提交于 2019-12-03 07:15:23
I am trying to understanding how MediaCodec is used for hardware decoding. My knowledge in android internal is very limited. Here is my findings: There is a xml file which represents the codec details in the android system . device/ti/omap3evm/media_codecs.xml for an example. Which means, that If we create a codec from the Java Application with Media Codec MediaCodec codec = MediaCodec.createDecoderByType(type); It should be finding out respective coder with the help of xml file. What am I doing? I am trying to figure our which part of the code is reading xml and find the codec based on given

Cannot make a static reference to the non-static method getSystemService(String) from the type

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-03 02:43:24
I have this function which network connection public boolean isNetworkConnected() { ConnectivityManager conManager = (ConnectivityManager)getSystemService(Context.CONNECTIVITY_SERVICE); NetworkInfo netInfo = conManager.getActiveNetworkInfo(); if (netInfo == null) { // There are no active networks. return false; } else { return true; } } But when i a trying to make it static so that i can use it in every activity it is throwing: Cannot make a static reference to the non-static method getSystemService(String) from the type I don't want to create the object of the class every time . Add the non

Android error while parsing Xml - android.os.NetworkOnMainThreadException

故事扮演 提交于 2019-12-02 17:42:31
问题 I am getting following error..... 08-18 00:02:19.230: D/CLIPBOARD(17993): Hide Clipboard dialog at Starting input: finished by someone else... ! 08-18 00:02:21.515: E/Connectivity(17993): true 08-18 00:02:21.535: D/AndroidRuntime(17993): Shutting down VM 08-18 00:02:21.535: W/dalvikvm(17993): threadid=1: thread exiting with uncaught exception (group=0x40c3c1f8) 08-18 00:02:21.545: E/AndroidRuntime(17993): FATAL EXCEPTION: main 08-18 00:02:21.545: E/AndroidRuntime(17993): java.lang

wifi getLinkSpeed() return a value always

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-02 10:12:27
I am developing an application that displays internet speed. like: https://play.google.com/store/apps/details?id=netspeed.pt https://play.google.com/store/apps/details?id=com.internet.speed.meter.lite&hl=en I have to gain WiFi speed at any moment, I used the runnable: WifiManager wm = (WifiManager)getSystemService(Context.WIFI_SERVICE); WifiInfo wifiInfo = wm.getConnectionInfo(); .... runnable = new Runnable() { @Override public void run() { int linkSpeed = wifiInfo.getLinkSpeed(); chatHead.setText( "Speed : " + linkSpeed); handler.postDelayed(runnable,100); } }; handler.postDelayed(runnable

Views not loading after updating device to Android Pie 9.0

馋奶兔 提交于 2019-12-02 10:09:38
I recently updated my phone to Android 9.0. The app which I was developing was working fine in earlier Android version. But after the update some views which require internet are not loading. Blank spaces are being displayed in their places. It has a ViewPager as banner and 2 RecyclerView below categories and deals respectively. They all require internet to load data. I don't know know if any extra permissions or dependencies are required in Android Pie. The logs show NetworkDispatcher.run: Unhandled exception java.lang.NullPointerException: Attempt to invoke virtual method 'int java.lang

Android error while parsing Xml - android.os.NetworkOnMainThreadException

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-02 08:35:49
I am getting following error..... 08-18 00:02:19.230: D/CLIPBOARD(17993): Hide Clipboard dialog at Starting input: finished by someone else... ! 08-18 00:02:21.515: E/Connectivity(17993): true 08-18 00:02:21.535: D/AndroidRuntime(17993): Shutting down VM 08-18 00:02:21.535: W/dalvikvm(17993): threadid=1: thread exiting with uncaught exception (group=0x40c3c1f8) 08-18 00:02:21.545: E/AndroidRuntime(17993): FATAL EXCEPTION: main 08-18 00:02:21.545: E/AndroidRuntime(17993): java.lang.RuntimeException: Unable to start activity ComponentInfo{org.yipl.rssfeed/org.yipl.rssfeed.News}: android.os

No internet access on Android Emulator, Shared Internet Connection

房东的猫 提交于 2019-12-01 21:15:41
问题 I have Installed Eclipse Juno and Updated the ADT as well to 22.0, I have created a custom AVD of Android 2.3 version as is working fine, but it seems there is no internet connection on my Emulator, Note: It also shows the 3G symbol on the title bar. Look the image of my emulator given below. Also worth noting, I connect to Internet via DSL internet cable right into my NIC card, and I also share my internet via wifi with my room-mates via connectify pro Hostspot. In this situation there is no

No internet access on Android Emulator, Shared Internet Connection

北慕城南 提交于 2019-12-01 18:53:17
I have Installed Eclipse Juno and Updated the ADT as well to 22.0, I have created a custom AVD of Android 2.3 version as is working fine, but it seems there is no internet connection on my Emulator, Note: It also shows the 3G symbol on the title bar. Look the image of my emulator given below. Also worth noting, I connect to Internet via DSL internet cable right into my NIC card, and I also share my internet via wifi with my room-mates via connectify pro Hostspot. In this situation there is no internet connection on my Emulator. But when I connect to the shared Internet of my friend's