Android Tutorial Working with Samsung Galaxy Tab

The Samsung Galaxy Tab is a neat Tablet running Android 2.2.

The following steps are required in order to connect it to the IDE.
- When the device is not connected, go to Settings - Applications.
Make sure that "Unknown sources" option is checked.
Open the "Development" page.
Check the "USB debugging" option and also the "Stay awake".

- Go to Samsung website: Samsung Mobile Innovator - Samsung Developer program for Symbian, Windows Mobile and Java
For some reason you cannot download the USB driver without registering.
So first register and then download the file under Samsung USB Driver for Windows.

- Install the driver - takes awhile...

- Connect the USB driver and the device should be connected in USB debugging mode.

It should now work with the IDE.

The Galaxy Tab layout is 600 x 1024 with scale = 1.5 (240 dpi).
In the designer you can choose New variant and create a matching variant:

galaxy_tab_1.png


That is it :)

galaxy_tab_2.png


See this page for some tips related to large screens emulators:
http://www.b4x.com/forum/basic4andr...-creating-emulators-large-screen-devices.html
 

susu

Well-Known Member
Licensed User
Longtime User
galaxy_tab_2.png


It looks like WebView, right? :D
 

karmacomposer

Member
Licensed User
Longtime User
Hmmm, so what if I want to develop strictly for landscape mode (I use a similar tablet - the Viewsonic Gtablet - is has identical specs, just a much larger screen), how would I force it into landscape mode and would I still enter 600x1024x1.5 or 1024x600x1.5?

Mike
 

Erel

B4X founder
Staff member
Licensed User
Longtime User

StuartM

Member
Licensed User
Longtime User
Am I wrong in attempting to do all layouts programatically based on 100%x and 100%y rather than using the designer?

I'm hoping that my non-graphics layouts work on "normal" screens (like my HTC Desire) and large ones (like my Galaxy Tab). It's OK so far, but short on docs.

The GUI designer seems like it is designed for a set of fixed sizes, rather than variable 100% layouts?

My only concern is that if I use the GUI editor I have to design for each size, but programatically doing 100%x and 100%y means auto-scaling without problems, unless I'm missing something?
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
There are several approaches. Layouts designed with the GUI editor will be scaled based on the device dots per inch value. So the same layout can be used with high resolution screens and low resolution screens.

So you can choose to create several layouts variants (2-3) to match different width/height ratios. At runtime the best fit will be selected.
 

NeoTechni

Well-Known Member
Licensed User
Longtime User
Am I wrong in attempting to do all layouts programatically based on 100%x and 100%y rather than using the designer?

Thats how I do it. I wish there was a way to have the designer do it that way too
 

Djembefola

Active Member
Licensed User
Longtime User
Am I wrong in attempting to do all layouts programatically based on 100%x and 100%y rather than using the designer?

That's what i do. I've never touched the Designer, not in VB and not in B4A.
 

Kevin

Well-Known Member
Licensed User
Longtime User
Confused....

Back when I was originally working on my app, I had created a layout for 600x1024 @ 1.5 scale, specifically for the Galaxy Tab.

I had created an AVD using the Galaxy Tab addon, which according to the specs, is 1.5 density. I could swear that this is what the B4A designer showed it as, but now I am adding some new stuff and happened to notice that the designer thinks the Tab AVD is 600x1024 @ 1 scale.

Now when I run my app on the Galaxy Tab AVD, everything is shifted to the upper-left corner. At this point I am not sure what to do.

Should I create a generic AVD 600x1024 @ 1.5 and use that as the Galaxy Tab, or should I create yet another variant now for 600x1024 @ 1? I've seen other reports here of the Designer showing the incorrect AVD specs, but I don't know which to believe. I want to make sure I am laying it out right.

:BangHead:
 

Kevin

Well-Known Member
Licensed User
Longtime User
I had a look at the specifications of the Galaxy, they show 600x1024 / 167 ppi. So you should create a variant for 600x1024 density 1.

Best regards.

Thanks for the info. I guess I will do that. What's odd is that if you create an AVD using the Galaxy Tab add-on and then look at its "details", it states:

hw.lcd.density: 240


Hence my confusion. So should I scrap the 600x1024 @ 1.5 layout and start over with the 600x1024 @ 1.0? Or should I also leave the 1.5 density layout in? This stuff confuses me, can you tell? :D
 

Kevin

Well-Known Member
Licensed User
Longtime User
Thanks again for your help Klaus.

I was just about to do this (delete the 1.5 and start over with a 1.0) but then I re-read Erel's first post in this thread:

The Galaxy Tab layout is 600 x 1024 with scale = 1.5 (240 dpi).
In the designer you can choose New variant and create a matching variant:

I don't really know which is right. I don't have a Tab to try, and I would hate to go and change it if it happens to look right as it is.

Edit: I just saw a "revision 1" for the Galaxy Tab in the AVD manager and Android SDK Tools Revision 12. After installing that, now it seems to be appearing as scale 1.5 to B4A (although I could swear it did this before).
 
Last edited:

Jim Brown

Active Member
Licensed User
Longtime User
I have a Galaxy Tab 7" and can confirm Erel's settings work correctly:

Portrait: 600 x 1024 with scale = 1.5 (240 dpi)
Landscape: 1024 x 600 with scale = 1.5 (240 dpi)
 

Kevin

Well-Known Member
Licensed User
Longtime User
I have a Galaxy Tab 7" and can confirm Erel's settings work correctly:

Portrait: 600 x 1024 with scale = 1.5 (240 dpi)
Landscape: 1024 x 600 with scale = 1.5 (240 dpi)

Thanks Jim. I guess I will just leave it then unless someone complains. I don't understand why earlier today B4A was reporting it as 1.0 scale when I'm almost certain that couple weeks ago it had been reporting it as 1.5.

I'm chalking it up as an Android SDK glitch, and as much as I like just about anything Google craps out, it can sometimes be a bit quirky. :cool:
 
Top