Download the free trial version
Basic4android Video
Features
Tutorials and manuals
Showcase
Screenshots

Go Back   Android Development Forum - Basic4android > Basic4android > Basic4android Getting started & Tutorials
Documentation Wiki Register Members List Windows Mobile Search Today's Posts Mark Forums Read

Basic4android Getting started & Tutorials Android development starts here. Please do not post questions in this sub-forum.

B4A-Bridge a new way to connect to your device

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 02-24-2011, 02:33 PM
Erel's Avatar
Administrator
 
Join Date: Apr 2007
Posts: 25,807
Awards Showcase
Basic4ppc Founder 
Total Awards: 1
Default B4A-Bridge a new way to connect to your device

There are several options to develop with Basic4android:
- Android emulator
- Connect to a real device in USB debugging mode
- Connect to a real device with B4A-Bridge. As of v1.9 B4A-Bridge supports wireless connections over the local network or Bluetooth connections.

The Android emulator is very slow compared to a real device (especially with applications installation). I recommend you to only use the emulator for working with the visual designer or for specific tests.

Usually the best option is to use USB debugging. You will need to first configure your device to support USB debugging (Settings - Development - USB debugging).
You will also need to install a windows driver specific to your device: OEM USB Drivers | Android Developers

Unfortunately not all devices support USB debugging. In that case you should use B4A-Bridge instead.

B4A-Bridge is made of two components. One component runs on the device and allows the second component which is part of the IDE to connect and communicate with the device.
The connection is done over the local network or with a Bluetooth connection.

Once connected, B4A-Bridge supports all of the IDE features which include: installing applications, viewing the logs, debugging and the visual designer (taking screenshots is not supported).

Android doesn't allow applications to quietly install other applications, therefore when you run your application using B4A-Bridge you will see a dialog asking you to approve the installation.

Getting started with B4A-Bridge
1. First you need to install B4A-Bridge on your device.
B4A-Bridge can be downloaded here: http://www.basic4ppc.com/android/files/b4a_bridge.apk. Some browsers may treat this file as a zip file. In that case you should restore its apk extension.

B4A-Bridge is also available in Google Play and Amazon Market. Search for: B4A Bridge.
Note that you need to allow installation of applications from "Unknown sources". This is done by choosing Settings from the Home screen - Manage Applications.

B4A-Bridge requires writable storage card. It is not possible to install applications without it.

2. Run B4A-Bridge on your device. It will display a screen similar to:



You should now choose either Start - Wireless or Start - Bluetooth depending on the working mode.
The Make Discoverable checkbox will make your device Bluetooth discoverable for 5 minutes. This is only needed if the device and computer weren't paired before.

3. Connect the IDE to the device

Go to Tools - B4A-Bridge and choose Connect Wireless or Connect Bluetooth.

Wireless connections
You will be asked to enter the device IP address. The IP is displayed on the device. In some cases the address displayed may be the mobile network address. In that case you can find the local wireless address in the wireless advanced settings page.

Bluetooth connections



In Bluetooth mode you should first click on Find Devices. All paired devices and new devices in discoverable mode will be listed.
You should choose the correct one and press on Connect.

Assuming that the connection succeeded the dialog will be closed.

The status bar at the bottom of the screen shows the current status:


That's it.

When B4A-Bridge gets connected it first checks if the designer application needs to be updated. In that case it will first install the designer application.

B4A-Bridge keeps running as a service until you press on the Stop button.
You can always reach it by opening the notifications screen:



Pressing on the notification will open the main screen.

As mentioned above, when you run an application you are required to approve the installation. You will usually see the following screens:



Note that the Bluetooth permission and Internet permission are automatically added in debug mode.



In the above dialog you should choose Open to start the application.
If you try to install an existing application signed with a different key, the install will fail (without any meaningful message). You should first uninstall the existing application. Go to the home screen - Settings - Applications - Manage applications - choose the application - Uninstall.

Once you finished developing you should press on the Stop button in order to save battery.

Bluetooth tips

- Unfortunately many devices, especially older devices running Android 2.1 or 2.2 have all kinds of issues with Bluetooth connections and especially with multiple connections. All kinds of workarounds were implemented because of these issues. Still however there are devices (HTC desire for example) that do not work reliably enough.

- The Reset Bluetooth button disables and then enables the Bluetooth adapters. You should try it if there are connections problems.

- If your connection is not stable then you should avoid using the debugger or designer. Both the debugger and the designer create an additional connection.

Note that B4A-Bridge was written with Basic4android.
The source code is available here: http://www.basic4ppc.com/forum/basic...html#post45854
Reply With Quote
  #2 (permalink)  
Old 02-24-2011, 02:43 PM
Cableguy's Avatar
Basic4android Veteran
 
Join Date: Apr 2007
Location: N 41º11'30.30" W 8º39'46.60"
Posts: 2,470
Awards Showcase
Forum Contributer 
Total Awards: 1
Default

Am I correct to assume that this will be using gprs data conection in the IDE to Device conection? If so, tis means that this conection will have a cost, according to your carrier Charging fees...
I remember reading somewere about a way to connect using Bluetoorh, is this possible with this app?
__________________
Paulo Gomes - Porto, Portugal - Living/Working in Brest, France
Samsung Galaxy S, Android 2.3.4 CUstom ROM; Galaxy Note II GT-N7100; Acer IconiaTab A510, Android 4.1.2 ; Toshiba NB100-130, Win7Ultimate
buy me a Porto glass
Reply With Quote
  #3 (permalink)  
Old 02-24-2011, 02:44 PM
Erel's Avatar
Administrator
 
Join Date: Apr 2007
Posts: 25,807
Awards Showcase
Basic4ppc Founder 
Total Awards: 1
Default

Quote:
Am I correct to assume that this will be using gprs data conection in the IDE to Device conection?
No. B4A-Bridge should be used when you have a wireless network available (both the device and the computer should be connected to the same router).
Reply With Quote
  #4 (permalink)  
Old 02-24-2011, 02:55 PM
Cableguy's Avatar
Basic4android Veteran
 
Join Date: Apr 2007
Location: N 41º11'30.30" W 8º39'46.60"
Posts: 2,470
Awards Showcase
Forum Contributer 
Total Awards: 1
Default

Nice...Would it also be possible to "bridge" multiple devices simultaneasly, with the log, or choose wich one to log from? For those who have 2 or 3 devices, this would mean realtime multi-Screen format debugging...
__________________
Paulo Gomes - Porto, Portugal - Living/Working in Brest, France
Samsung Galaxy S, Android 2.3.4 CUstom ROM; Galaxy Note II GT-N7100; Acer IconiaTab A510, Android 4.1.2 ; Toshiba NB100-130, Win7Ultimate
buy me a Porto glass
Reply With Quote
  #5 (permalink)  
Old 02-24-2011, 03:07 PM
Erel's Avatar
Administrator
 
Join Date: Apr 2007
Posts: 25,807
Awards Showcase
Basic4ppc Founder 
Total Awards: 1
Default

You can only "bridge" to a single device. However you can have multiple connections with 'adb'. So you can work with one device for running the code (with B4A-Bridge) and also be connected to the emulator with the designer.
Reply With Quote
  #6 (permalink)  
Old 02-24-2011, 03:36 PM
Cableguy's Avatar
Basic4android Veteran
 
Join Date: Apr 2007
Location: N 41º11'30.30" W 8º39'46.60"
Posts: 2,470
Awards Showcase
Forum Contributer 
Total Awards: 1
Default

Ok, so can you please add-it to the Bridge wish list?
__________________
Paulo Gomes - Porto, Portugal - Living/Working in Brest, France
Samsung Galaxy S, Android 2.3.4 CUstom ROM; Galaxy Note II GT-N7100; Acer IconiaTab A510, Android 4.1.2 ; Toshiba NB100-130, Win7Ultimate
buy me a Porto glass
Reply With Quote
  #7 (permalink)  
Old 02-27-2011, 04:52 PM
Cableguy's Avatar
Basic4android Veteran
 
Join Date: Apr 2007
Location: N 41º11'30.30" W 8º39'46.60"
Posts: 2,470
Awards Showcase
Forum Contributer 
Total Awards: 1
Default

B4A 1.3 and B4A Bridge First impressions...

Speed! I could almost say that this is much Faster than the previous version...very much faster...
The Bridge works very smothly, and the connection is easy to stablish..
I have one wixh for the Bridge, On the device side...That is to KeepALive the screen when connected...Or give the user that option..
Everything else is perfect..

Thanks EREL
__________________
Paulo Gomes - Porto, Portugal - Living/Working in Brest, France
Samsung Galaxy S, Android 2.3.4 CUstom ROM; Galaxy Note II GT-N7100; Acer IconiaTab A510, Android 4.1.2 ; Toshiba NB100-130, Win7Ultimate
buy me a Porto glass

Last edited by Cableguy : 02-27-2011 at 07:26 PM.
Reply With Quote
  #8 (permalink)  
Old 02-27-2011, 06:03 PM
Erel's Avatar
Administrator
 
Join Date: Apr 2007
Posts: 25,807
Awards Showcase
Basic4ppc Founder 
Total Awards: 1
Default

Thank you Cableguy.
Reply With Quote
  #9 (permalink)  
Old 02-27-2011, 08:50 PM
Junior Member
 
Join Date: Mar 2008
Posts: 28
Default

Has V1.3 and the bridge been released?

I didn't see any emails, so just wondering.

Alan
Reply With Quote
  #10 (permalink)  
Old 02-28-2011, 12:03 AM
alfcen's Avatar
Basic4android Expert
 
Join Date: Apr 2007
Location: Okinawa, Ryukyu Islands
Posts: 873
Send a message via Skype™ to alfcen
Awards Showcase
Beta Tester 
Total Awards: 1
Default B4A Bridge

Installed and tested. Works like a charm with a Sharp IS03 phone over my home WiFi. No extra wishes, invaluable IDE enhancement that embraces phones with poor or no ADB performance! Looking forward to what else is new in V 1.3.

Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Basic4PPC on Device connect to Delphi Host Xuphas Questions (Windows Mobile) 5 01-20-2012 06:29 AM
How to connect device instead of using emulator BlackVMI Basic4android Updates and Questions 1 12-28-2010 04:35 PM
connect to mysql server from device encolo Questions (Windows Mobile) 5 08-30-2010 04:50 PM
Program for Recording Bridge Hands dlfallen Share Your Creations 0 01-25-2010 12:49 AM
with basi4ppc (device) can we connect to SQL SERVER (situated on a pc) ? gecomail Questions (Windows Mobile) 2 11-24-2008 08:52 PM


All times are GMT. The time now is 03:15 PM.


Powered by vBulletin® Version 3.6.12
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0