android-internet

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

送分小仙女□ 提交于 2019-12-21 03:53:25
问题 This question already has answers here : Simulate low bandwidth in android (11 answers) Closed 5 years ago . 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

How MediaCodec finds the codec inside the framework in Android?

别来无恙 提交于 2019-12-20 23:25:29
问题 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

Views not loading after updating device to Android Pie 9.0

99封情书 提交于 2019-12-20 06:39:54
问题 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:

wifi getLinkSpeed() return a value always

自古美人都是妖i 提交于 2019-12-20 05:53:47
问题 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

How to Set Tag to the request and get it from Response Volley asynchronous request?

蹲街弑〆低调 提交于 2019-12-19 10:48:13
问题 I have an Android application with multiple REST Api's. The API's are managed using the Volley library. The response is getting and it's woking fine. But when I make asynchronous requests, I can't identify the response of each request. My request method is this: private void httpCall(String URL, String json, String session key, int type) { try { SSLContext sslcontext = SSLContext.getInstance("TLSv1"); sslcontext.init(null, null, null); SSLSocketFactory NoSSLv3Factory = new

How to detect upload/download transfer rate in Android?

会有一股神秘感。 提交于 2019-12-18 12:46:04
问题 I am working on an app which uploads a large amount of data. I want to determine the transfer rate of the upload, to show in a notification. One post suggests using the WifiInfo which will not work for mobile data. Another post suggests getting the network type to estimate the speed. I'm not satisfied with the answers in these posts, so I am asking again. I've seen apps which display the upload transfer rate, as well as some custom ROMs like Resurrection Remix. How can I determine the

How to forget a wireless network in android programmatically?

纵然是瞬间 提交于 2019-12-17 22:16:42
问题 I am working on an app which wifi , where user will be asked to enter password for the scanned network he selects, if user enters a correct password, it connects and works well. But when user enters wrong password, a new network is added with that name, and will be failing to authenticate cos of wrong password, and it will be having authentication problem status. Now if user tries to again scan and select the same network, and enters correct password, it fails to connect even though password

android how to get indicate when the internet connection is lost?

柔情痞子 提交于 2019-12-17 18:29:09
问题 I'm developing an android application and I want to get a notification when the internet (wifi or packet data connection) connection is lost. On my approach I can get the status of the connection as: private boolean isNetworkAvailable() { ConnectivityManager connectivityManager = (ConnectivityManager) getSystemService(Context.CONNECTIVITY_SERVICE); NetworkInfo activeNetworkInfo = connectivityManager.getActiveNetworkInfo(); return activeNetworkInfo != null && activeNetworkInfo.isConnected(); }

Android get browser's address

北战南征 提交于 2019-12-13 00:55:02
问题 Is there a way to get address from the browser that user is trying to open using some listener or something, and if the address is in the database and the address is banned, stop loading that address in the user's browser? 回答1: Android is a flavour of the Linux operating system and what you want to do is essentially create a firewall. To allow the creation of a firewall in Linux, Netfilter is provided: Netfilter is a set of hooks inside the Linux kernel that allows kernel modules to register

why get java.lang.IllegalStateException: Unable to create directory error?

吃可爱长大的小学妹 提交于 2019-12-12 04:36:47
问题 I use DownloadManager class to download a file in android and this is my code for download: Uri downloadUri = Uri.parse(urlString); DownloadManager.Request request = new DownloadManager.Request(downloadUri); request.setDescription(des).setTitle(titleAudio).setNotificationVisibility(DownloadManager.Request.VISIBILITY_VISIBLE_NOTIFY_COMPLETED). setDestinationInExternalPublicDir( "/my file name/" , titleAudio + String.valueOf(colForUrl) + pasvand); long id = downloadManager.enqueue(request);