Android Tutorial Connecting your device to the IDE

agraham

Expert
Licensed User
Longtime User
Is there any chance post #1 could be edited to fix this?
Done. I note that you seem to have the Android SDK installed under "Program Files". While this is OK on Windows XP I would recommend that you put it elsewhere on Vista and Windows 7 because of the extra protection these OSs give to the contents of Program Files which can on some occasions cause problems.
 

asawyer13

Member
Licensed User
Longtime User
I am new to B4A so if this is explained somewhere else, just let me know.

I have a Droid X. I have B4A 1.10. I have the emulator installed and I can run the Guess My Number app in the emulator. I have the Android Composite ADB Interface showing in the Device Manager on my Win 7 64 bit system.

My Droid has the USB symbol on it.

I am trying to figure out how to run this on my Droid. Can I go into Designer, and connect and it will connect to my Droid since the AVD manager isn't running? Do I somehow compile and copy the apk to my Droid? and then run it from there?

I'm sure it's just something simple that I don't understand.

Alan
 

asawyer13

Member
Licensed User
Longtime User
Okay, I didn't have my Droid set to the correct usb mode.
So now I can see my SD card, and when I go to Tools -> Connect in Designer, my application runs on my Droid when I do an F5.. Cool.

Now if I want to actually deploy it on my Droid, is there a set of instructions on the best way to do that?

This is so cool.

Alan
 

agraham

Expert
Licensed User
Longtime User
Now if I want to actually deploy it on my Droid
You already have. It is installed as a normal application and can be removed like a normal application if you no longer want it. As long as you don't want to upload it to the Android Market you don't need to do anything else.


By the way Tools -> Connect in Designer has no effect on running your application by F5. Connect runs the Designer on the phone. F5 runs your application on the phone.
 

asawyer13

Member
Licensed User
Longtime User
@agraham,
Duh, I didn't notice my app was sitting there in the list of apps on my Droid.
Thanks,
Alan
 

Lordshiva1948

Member
Licensed User
Longtime User
I have ADB installed and works fine with my phone. My phone is STAR A3000 and works fine with ADB.
 

James Moxham

Member
Licensed User
Longtime User
Coming back to this after not programming for a few months and I have forgotten how to get this working. So, for dummies:

1) Turn on the android device. Hit the "menu" button which is near the top right and is four bars one above the other. Click on Settings. Click on Wireless Controls. Click on Wifi Settings. There will be several lines of text. The first is Wifi - connected to "mynetwork". Don't click that. The next is Network Connection. Forget that one too. Then there is "Wifi Networks" under that is "mynetwork" and hopefully it says "connected". Click that, and it should come up with your IP address. Note this. (mine is 192.168.2.2)

2) In windows, Start/Run and type CMD. Browse using the "cd" command to C:\Program Files\Android\android-sdk-windows\platform-tools
Then in the dos window, run this command "adb connect 192.168.2.2" where the ip address is the number noted above.

Now run Basic4Android with this program:
B4X:
'Activity module
Sub Process_Globals
   'These global variables will be declared once when the application starts.
   'These variables can be accessed from all modules.

End Sub

Sub Globals
   'These global variables will be redeclared each time the activity is created.
   'These variables can only be accessed from this module.

End Sub

Sub Activity_Create(FirstTime As Boolean)
    Log("Hello world!")
    Msgbox("Hello world", "First program")
End Sub

Sub Activity_Resume

End Sub

Sub Activity_Pause (UserClosed As Boolean)

End Sub

I wonder if this could be added somewhere in the Basic4Android program - maybe all this could come up in the error message when you hit the compile button and it fails to connect.

(This is usually because the adb program needs to be told the IP address again).
 

harinder

Active Member
Licensed User
Longtime User
adb.exe

Hello there..I have installed the emulator correctly.But, on connecting the designer to emulator,im asked to restart adb server and then it says can't find adb.exe.Please help.The javac.exe and android.jar file paths are cofigured correctly.Thanks..
 

RandomCoder

Well-Known Member
Licensed User
Longtime User
I know this is an old thread now, but I just wanted to add my own experience connecting an LG Optimus GT540 to the IDE, as it may help someone having similar problems connecting to the IDE.

I followed Andrews instructions meticulously but everything I tried resulted in being unable to connect to the LG even though other devices work perfect. Eventually I found that you could use the command line 'adb devices' to list all devices seen by the PC, and this showed no device connected. That led me to believe that the phone was at fault. Yes I'd checked the box for USB debugging etc but still no joy :BangHead:

The fix for my problem was to remove the SD card, then connect to the PC. As soon as I did, Windows sprang into life and installed a new driver that recognised the phone as an LG and allowed USB debugging. I can now plug the SD card in and still connect to the IDE. So if anyone else is having similar problems it might just be worth trying to remove the SD card to see if it helps.

Regards,
RandomCoder.
 

zouriteman

Member
Licensed User
Longtime User
Unable To Connect

You say that ADB can run with this command line :

ADB connect 192.168.1.xxx ( xxx is my good ethernet adress)

I have the good adress , but the port (5555) seem to not valid , because ADB refuse to run.

message :
"Unable to connect to 192.168.1.xxx:5555"

have you some idea ?
 

siaobukol

Member
hello, can you teach me a step by step procedure on how to connect my BASIC4ANDROID application on my computer desktop using WIFI?
 

enonod

Well-Known Member
Licensed User
Longtime User
Hope I am not out of place here...
I notice on my Viewsonic Viepad 7 that when connecting via usb instead of wi-fi then a usb symbol appears on the notification bar at the top of screen and on the PC I get a CD drive but it is not showing the SD Card.

To actually see the SD I must pull down the notification bar which then has an entry 'USB connected' which instructs to tap (select) to copy files to/from computer.
On tapping, a button appears on Android screen saying 'turn on usb storage'. On clicking, the SD card appears as a second (not CD) drive. The button remains on screen saying 'turn off usb storage' which of course reverses the process and removes the SD card drive from the PC but leaves the CD drive of some 8Mb and shows adb.exe among others.

This may be useful for anyone unable to find their SD card on the PC
 

latcc

Banned
Hi Andrew

I also have a SanFran phone and I have been trying to follow the link you gave to get the USB drivers. I have downloaded this...

ZTE Android USB Driver for Microsoft PC_5.2066.1.8(Updated on Mar.31 2011)

Is this the correct driver for our phone? I only ask as there isn't an Orange San Francisco driver on the page you pointed to. But I know this phone is also called a ZTE Blade.

If not do you have a link to the usb driver for the SanFran?
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…