Android Question Connection by usb cable to a phone

johnaaronrose

Active Member
Licensed User
Longtime User
It would be nice to connect to an Android phone by usb cable and have the Compile&Run menu item use it. When I try to do this, B4A says that no device is found: I don't have an emulator setup and I'd prefer not to use one.
 

toby

Well-Known Member
Licensed User
Longtime User
You need to enable us debugging on your phone first. Steps:
1. Open the Settings app.
2. Select System.
3. Scroll to the bottom and select About phone.
4. Scroll to the bottom and tap Build number 7 times.
5. Return to the previous screen to find Developer options near the bottom.
6. Scroll down and enable USB debugging.
 
Upvote 0

agraham

Expert
Licensed User
Longtime User
You probably don't have the correct USB driver installed for the phone
 
Upvote 0

johnaaronrose

Active Member
Licensed User
Longtime User
@toby I have done all those steps previously. USB debugging is enabled. I'd previously installed B4A-Bridge and that worked. I've even uninstalled B4A-Bridge and tried again.
@agraham I am able to run adb in Terminal (on my Ubuntu box) to see my phone and to transfer files from my box to my phone.
 
Upvote 0

johnaaronrose

Active Member
Licensed User
Longtime User
I also have a problem with B4A-Bridge. I have connected to phone using B4A menu item. I have also started B4-Bridge using recommended ip address and its Status shows with a link symbol. When I Compile&Run, phone asks me if I want to install app and I click Install. It then comes out with a popup saying that app is blocked by Play Protect: this app was built for an older version of Android and doesn't include the latest privacy protections. Options are INSTALL ANYWAY and OK. I clicked INSTALL ANYWAY. It then pops up with an Open option. It then starts the app. Is this popup by Play Protect expected behaviour?
 
Upvote 0

JordiCP

Expert
Licensed User
Longtime User
Is this popup by Play Protect expected behaviour?
Yes.
Probably the targetSDKVedrsion in your manifest file is set to a low value because it is not a new project or you are using an old B4A version. Edit the manifest file and set targetSDKVersion to a higher value.
Depending on the features that your app is using, it's possible that some things will not work as before because of extra permissions needed.
 
Upvote 0
Top