I have a scenario where I want to use wifi to connect to the internet (comfortably via androids settings) and ethernet for accessing local network which is not connected to the internet.
Thus I want to have both ethernet and wifi up simultaneously and use the routing table to send all the local requests to the ethernet and the default to wifi.
I found out android disables wifi when ethernet is enabled...
There has been a fix for an old android version on https://android.googlesource.com/platform/frameworks/base/+/refs/heads/pie-release/services/core/java/com/android/server/ConnectivityService.java
Problem: In Android 9 the file looks different and I cannot find the lines mentioned...
I am using a Khadas Vim3 and their android build.
Can you please help me, which lines need to be changed?
This is the file:
https://android.googlesource.com/platform/frameworks/base/+/refs/heads/android10-c2f2-release/services/core/java/com/android/server/ConnectivityService.java
Thanks in advance
Related
I need to make communication between PC software (written in java) and android app over usb cable. The PC software will send some data (Strings) to Android app witch will accept those strings and do some action depending on the message received.
What is the best way to do this?
I am looking all over the internet and can't find any solution to this. If someone has example of this communication i would be very grateful.
I already done this communication over sockets, put i need to cover situation if there is no router or internet connection.
Thank you
Check following article. I guess similar question to your on SO.
If you want to communicate between Android USB device and some USB host you need to use the accessory mode (https://developer.android.com/guide/topics/connectivity/usb/). But this mode requires special driver support on the USB host side (which is your PC).
Since my app runs on the emulator and crashes on my device. I would like to see log report of my app directly from the device. So that it might lead to better way of debugging. But I have following problems
My device is connected to the PC via LAN.
My device doesn't have USB connection (no slave port).
I am using android studio as IDE. I have seen couple of examples which could be used if the device is connected to same wifi network like Debugging over wifi network but this doesn't help.
There is an official documentation with wifi official documentation for wifi still it needs USB connection in step 3.
Does Android Studio provide any type of solution?
if your app is firebase configured maybe you can use DebugView from firebase site.
To get the crash reports from any android device you can use crashlytics..
This is very nice library which provides you very details logs of crash along with many other details like android device name, ram size, memory, orientation etc..
Good thing is that this crashlytics was different library previously, which is now part of Firebase .
To get started you can know about crashlytics from here you can follow the documentation from here
Actually, firebase helps you get the crashlytics. The error message will be stated in the dashboard once the app crashes. This is a life saver but I found out that, we can simply connect the device to IDE without USB. Just the PC and your device should be connected via LAN
Using ADB tool. Run the adb.exe file as admin. Connect using tcp. Just address and Port is necessary.
You can simply debug from the IDE, In my case android studio.
I want to send and receive data from a Linux based hardware piece to an android device. The hardware device is connected to Hotspot created by android device. Can you please suggest some links or tutorial from where I can get idea how to establish communication between hardware device and the android device to send and receive data through WI-FI .Please Help any sample code or links
There is an enormous amount of ways to do it. The easiest one is running an ftp server on the linux machine and upload the file to it from the Android app via the FTPClient class from Apache Commons.
While this is very easy to establish it is very unsecure, and should only be used in your local wifi.
I am developing an app in which the first thing i need is how to get devices that are connected to my wifi network or same wifi network .ie ip adress,device name etc.
I don't have any idea how to do that have searched alot but there are no examples available.
I have done one thing that i will ping 255 ips and whichever will respond will be the connected ips but the problem here is that there are virtual ips already assigned to some websites so i need to detect only the real device ip addresses.
I want to do the same thing as done in the app WifiTalkie
Follow Any one of the following:
Way1:
If you mean you want to see all the devices connected to your current WiFi connection (and you are not trying to do Ad Hoc networking), then you are essentially wanting to run a network scanner.
There are a bunch of these around. This one has the source available on github
http://rorist.github.com/android-network-discovery/
Way2:
Refer How to detect all the Devices connected in a WiFi network from Android App
While using bluetooth to share files from one android mobile as server and many mobiles (20-30) can download files simultaneously from that server.
What are the limitation of bluetooth api in android ?
Is it possible ?
How do you prefer to do this? On bluetooth or via wifi ?
Thanks
You can only have 7 slaves for a bluetooth master, so if if you need 20-30 simultaneous connections this may not work. This is a bluetooth restriction, not Android.