927 questions
0
votes
1
answer
260
views
How to set Ethernet down by default in Android AOSP code
By default, Android bring up an ethernet interface through addInterface() in EthernetTracker.java. That is, When a ethernet cable is connected, it will bring up that interface and set Ip automatically....
2
votes
1
answer
238
views
What is the difference between OEM_PAID and OEM_PRIVATE networks in Android [closed]
I see OEM_PAID and OEM_PRIVATE networks in android.
I see below info in PANS documentation.
OEM_PAID Used primarily for apps that can be routed on both OEM and non-OEM networks.
OEM_PRIVATE Used ...
0
votes
0
answers
61
views
How to get a list of available networks
I am using this:
fun startNetworkObserver() {
try {
val builder = NetworkRequest.Builder()
builder.addTransportType(NetworkCapabilities.TRANSPORT_CELLULAR)
builder....
1
vote
0
answers
28
views
How to solve AndroidNetworking usees error
I am learning Android development, and then I found an error with Android networking uses.
I add this implementation (com.github.amitshekhariitbhu.Fast-Android-Networking:android-networking:1.0.4"...
0
votes
0
answers
16
views
Android Studio App crashes sometimes when trying to get data from local webserver [duplicate]
I am currently trying to build my first app with android studio.
I am trying to access data from a webserver
My code is:
class MainActivity : AppCompatActivity() {
override fun onCreate(...
0
votes
1
answer
136
views
Is It Technically Challenging to Implement L2TP in an Android App?
I just switched from iOS to Android and found out that with the release of Android 12, Google removed support for L2TP VPN protocol. I’ve been searching for third-party VPN apps that still support ...
1
vote
0
answers
140
views
SSE stops receiving data after 5 minutes on mobile network (OKHttp Android)
I'm using SSE (Server-Sent Events) in an Android app with OkHttp. After 5 minutes of idle time, the connection stops receiving data on mobile networks, but works fine on WiFi. No errors or callbacks ...
1
vote
0
answers
140
views
Force Android to use mobile data even if other network interfaces are available?
I have an Android device that's used for mobile testing. This device has cell connectivity and is separately connected to the local network over ethernet (which is used for ADB).
How can I configure ...
2
votes
1
answer
126
views
"Connecting to VM Service at ws://127.0.0.1:50268/yZ6Ui9WuIGw=/ws "error
I am trying to run my flutter application on android virtual device using vs code but when I run the code it shows following error
I/xample.chalbha(11197): Waiting for a blocking GC ProfileSaver
and ...
1
vote
0
answers
114
views
How to connect ipv6 through DHCP via WIFI android?
I need to connect ipv6 through WIFI.
But below code works without turning on WIFI. Let me know how to get ipv6 by turning on WIFI. I am bit confused and can you please guide me.
public String ...
2
votes
1
answer
1k
views
frida-server being targeted by port scan?
Whenever I install and start frida-server, I have a banking app that behaves weirdly. After some research, I discovered some app may be able to do a port scan on the device running frida-server at the ...
0
votes
1
answer
127
views
Track application id or package name using DatagramPacket in android
I open a socket and track network calls in the Android application. Currently, I can view the hostname and IP address of the coming network traffic using the DatagramPacket class. Is it possible to ...
2
votes
1
answer
415
views
What is HttpEngine in android.net.http
I noticed there are new class in the android.net.http package. Some of them are added in API 34, also in the S Extensions 7. I encountered the HttpEngine class in the package, the summary says that
...
5
votes
0
answers
4k
views
android.net.ConnectivityManager$TooManyRequestsException
Note: Don't mark this as duplicate as this existing answer does not solved my query android.net.ConnectivityManager$TooManyRequestsException in android while network call
Update Wed 28 Jun : Found ...
0
votes
0
answers
322
views
How can I find which http (not https) requests my Android app is making and know the domain they are of the request?
My app is required to have the cleartextTrafficPermitted="true" attribute, which is a problem because some third party libraries think that means they can use http instead of https.
I've ...
1
vote
0
answers
70
views
Untitled download occure when I try to download from a local server
I run an android app that let me download file from an URL, I used download manager to download the files, it works just fine when I use a public URL server from the internet but when I use my local ...
-1
votes
2
answers
444
views
Android java widget call http error android.os.NetworkOnMainThreadException [duplicate]
I am having the following error:
FATAL EXCEPTION: main
Process: com.name.app, PID: 21535
java.lang.RuntimeException: Unable to start receiver com.name.app.MyWidget:
android.os....
2
votes
0
answers
304
views
ioctl() invocation with 'SIOCGIWNAME' returns EOPNOTSUPP for wireless interface
I'm trying to run the following code in the native stack of my app on Pixel 6 running Android 13. Unfortunately, the ioctl() API invocation for the wireless interface wlan0 is returning error code 95 (...
3
votes
0
answers
141
views
Why does get I get -2147483648 upon calling networkCapabilities.getSignalStrength() function?
So I have implemented a network callback of type ConnectivityManager.NetworkCallback, and in the overridden function override fun onCapabilitiesChanged(network:android.net.Network,networkCapabilities: ...
0
votes
1
answer
107
views
How to create a common worker when using WorkManager?
I want to create a NetworkRequestWorker which executes a network request using WorkManager.
All network requests would have a similar set of logic:
Parameters for network request (request body)
Do ...
0
votes
1
answer
390
views
Calling multiple APIs using Coroutines causes error
I have a list of 30 objects for which I need to call API. I then add the result of all API calls and return as answer. But it gives 503 error after few calls.
override suspend fun getScoreboard(docId: ...
0
votes
1
answer
1k
views
How to have the app check for mobile data ONLY in Android Studio
So in this app, it is required to use some sort of network because there's API calls involved. There's an error that pops up when there's no mobile data around. The thing is, it also pops up when I ...
1
vote
0
answers
443
views
Android AppWidget using WorkManager experiencing network issues
I have an application in production that contains an AppWidget that schedules periodic refreshes via a WorkManager CoroutineWorker. My RefreshWidgetWorker simply requests some data from a Retrofit ...
0
votes
1
answer
409
views
Is there any way I can log network calls been triggered from the SDK/Android libraries in my app
I am developing an Android SDK/library, In here I am performing several network calls. But I don't want the Application developer(who uses my SDK) can log the network calls I performed from my sdk. As ...
0
votes
1
answer
31
views
Accessing object creating in Activity/Fragment from a receiver
This is probably not feasible, but I have a WearOS app that has downloading functionality. According to the documentation, I can request a high-bandwidth network:
https://developer.android.com/...
-2
votes
1
answer
443
views
Possible Android hotspot interface names
Is there any way to get the name of the interface working for WiFi hotspot?
I have seen that there are many names e.x ap0, swlan0 etc.
Anybody knows other names or a way to find it easily?
0
votes
0
answers
38
views
Is there a option or other solution for quick intervals in WorkManager?
In my app, I want a worker to request my server every 1 minute using ( PeriodicWorkRequest ) whether there are new messages for the user.
The transmission is therefore kept very small and always ...
0
votes
1
answer
150
views
Android 5.0 (API 21) UnknownHostException:
I am getting these error logs when the API is called from any device running Android 5 (API 21). Not sure if it's related to the networking library or any legacy issue with Android version 5 and below....
1
vote
0
answers
106
views
How to handle Cancel button on the dialog shown by NetworkRequest.Builder().setNetworkSpecifier
I'm trying to connect to WiFi AP provided by peripheral device with NetworkRequest.Builder().setNetworkSpecifier().
I succeeded to connect but I still have a problem in failure case.
fun ...
-1
votes
1
answer
427
views
Good way for detecting if a device is connected to the internet in Android using Java
I am trying to make a function that detects if an user is connected to the internet so that I can request a new interstitial ad in case this function returns true.
This is the function I made, but now ...
0
votes
1
answer
186
views
What is the proper way to do an HTTP GET on older versions of Android?
I've been having an issue making HTTP GET requests consistent between versions of Android. On Android 7-12, this code works perfectly for accessing my remote server, and gets a response back ...
1
vote
0
answers
659
views
internet connected check using NetworkCapabilities
I am using this code after checking several posts in stackoverflow.com
It works fine when connected to Cellular and senses whether it is online. However, for Wi-Fi, it gives 'true' always. Observed ...
0
votes
0
answers
1k
views
check internet using ping
I am using this code for checking internet connectivity. It works fine and when the device is offline, the screen just blanks out. Is there a method to show some screen during the wait?
public boolean ...
4
votes
1
answer
2k
views
Is it relevant to check network capabilities if I specified them in the network request
In my code, I need to track the internet connection and make appropriate changes. First of all, I create a network request, then register a network callback using the ConnectivityManager.
val ...
0
votes
0
answers
167
views
How to do I create a separate thread to do a network operation in Android? [duplicate]
I am trying to convert a URL to Base64 in Kotlin. I am using Apache Commons IO to accomplish this by first converting the URL to a ByteArray:
val imageBytes = IOUtils.toByteArray(URL(url))
This line ...
2
votes
1
answer
968
views
Android WorkManager Network Constraint For Both Wifi and Data (Cellular)
I am learning WorkManager and wondering if following the correct way of setting network constraint for both Wifi and data (cellular):
val constraints = Constraints.Builder().run {
...
0
votes
0
answers
145
views
The device has 4G, but NetworkInfo.isConnected() show that there is no Internet connection
I have one strange reported by one of the clients. They are on 4G, but in the app it says that they do not have Internet connection.
In the app I am using this logic to inform the user that they have ...
0
votes
1
answer
754
views
Localhost restAPI access from Android Studios on physical device using cable
I have created an API in DjangoREST,and it is running on my localhost with address http://localhost:xxxxx/api/allproduct.
I have also created an Android app in Futter, using Android Studio and tried ...
0
votes
0
answers
163
views
How to control simultaneous stable traffic (for any consumers: Maps, Auth, ffmpeg) to Cellular & to WiFi device (known port) for Android App?
Problem:
By default, Android has only one active Network, so when you have your other device connected to your phone over Wi-Fi (IoT, Dashcam, whatever, obviously with no internet), your Android ...
1
vote
0
answers
237
views
Binding socket to network 332 failed: EPERM
In one of our android app while trying to connect to server using https, it is throwing me error saying,
network capability changed: [ Transports: WIFI Capabilities: NOT_METERED&NOT_RESTRICTED&...
3
votes
1
answer
2k
views
How to give WiFi higher priority than Ethernet on android 9?
I'm working on android 9 and I want to give preference to WiFi over Ethernet.
I tried giving wifi higher priority than ethernet in my config.xml file as shown below but still my ethernet has higher ...
2
votes
0
answers
308
views
NetworkManagementSocketTagger: tagSocket(73) gettings spammed in logs
I'm getting many, many entries in my Android app logging (I've replaced application id with xxx.xxx.xxx):
2021-09-14 09:40:11.131 21345-22853/xxx.xxx.xxx D/NetworkManagementSocketTagger: tagSocket(73) ...
0
votes
1
answer
241
views
Android Data Loading Strategy with ViewPager2 and TabLayout
Say, I am going to download two tables of data from the web server, categories and items:
data class Category(val id: Long)
data class Item(val id: Long, val name: String, val categoryId: Long)
Then ...
0
votes
1
answer
430
views
Check if device supports LTE Data Connection
I am learning Android development to my own and wandering to know if my device has the hardware that can support the LTE network.
I am trying the below, but I think it is giving me wrong data
...
0
votes
1
answer
171
views
Json Response conversion Stuff in Android
Below is the model class I am created for my json response :
data class MyModelClass(
val one: String,
val two: String,
val three: String,
val four: Int,
val ...
0
votes
1
answer
506
views
Added Passpoint not connecting
I have added a passpoint configuration in my app on Android 11.
The add works perfectly but it doesn't connect.
I tried to get a list of which passpoints are added but get an empty list.
val ...
0
votes
0
answers
60
views
Socket Service has error when received a data in Android
I am new to Android.
It runs well before receiving data from the Putty(PC)
but Error message printed when received a data
SocketServer$SocketServerThread.run(SocketServer.java:56)
"...
4
votes
0
answers
685
views
How do I avoid "Something came up" error using ConnectivityManager.requestNetwork when the screen is off?
I've got a Foreground Service (extends androidx.core.app.JobIntentService) that gets work enqueued when a push notification comes in. Its job is to connect to the Wi-Fi AP of an IoT device and ...
0
votes
1
answer
2k
views
Getting error in Fetching news api from newsapi.org
I am making News App using Newsapi.org API key I have written all the code and compiled successfully but app is not fetching any data through that key.
This is my MainActivity.java file
package ...
0
votes
1
answer
894
views
Android Get Status of Wifi Connection
I'm currently using NetworkRequest and NetworkCallback approach (recommended by Google official) to get status of Wifi connection, and it works partially.
I'm expecting the onUnavailable() will get ...