Disappointed with B4A and Emulation

DetTigersFan

New Member
Licensed User
Longtime User
I'm new to Android and Apps but not programming. I thought that B4A might be a great programming language and could be very useful to me except that emulation on a PC is useless. It is simply too slow to be of any value. I looked at the X86 emulator but have not tried it as it complicates further an already complex process.

I've used embedded cpu emulators before and they generally ran well so my expectations were high.

I understand most of the issues but knowing them does not help resolve them.

I understand that the code can easily be downloaded to an Android device and run there but that negates the advantages of running on a PC (like having a 32" ultra high res monitor).

I am open to suggestions, thanks in advance.
 

NJDude

Expert
Licensed User
Longtime User
Just a couple of observations, B4A has nothing to do with the emulator, the emulator is provided by Google as part of the SDK, and yes, it is painfully slow and not recommended for development.

The second observation, you mentioned installing/running an Android app on a PC, well, there are tools out there like BlueStacks which can run Android apps on PCs.
 
Upvote 0

lagore

Active Member
Licensed User
Longtime User
I believe that is nothing to do with B4a, you will get the same response if you program in java using the eclipse IDE and emulator, it works but is a bit slow you really need to use a connected device

Sent from my HTC One X using Tapatalk 2
 
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
As written above the emulator is not part of Basic4android, it is part of the Android SDK. You will get the exact same speed if you use Eclipse / Java.

I recommend you to use a real device instead. Either with B4A-Bridge (unique to Basic4android) or with USB debugging.
B4A-Bridge a new way to connect to your device
 
Upvote 0

sorex

Expert
Licensed User
Longtime User
also notice that the bluestacks tool doesn't install if it doesn't detect OpenGL 2.0 on your system/gfx_card.

If you're out of luck like me the best thing is to attach your phone/tablet straight to your development pc. it's still guessing how it would look on other devices unless you use that slow emulator again which is a waste of time.
 
Upvote 0

kanaida

Active Member
Licensed User
Longtime User
I haven't tried this but it would be amazingly fast. Download blue stacks its an app that turns your PC into an android device at native speed. I ran my apps in it and in theory you can install the b4a bridge and use it as your dev device. Its actually very impressive. As for b4a, its a nice simple fast IDE that simplifies many hard things and its been a pleasure to work with. The best part is the support and community though, people share useful libraries and there is always someone willing to help out. All this at a great price. Trust me give it a shot.
 
Upvote 0

kanaida

Active Member
Licensed User
Longtime User
The other option you have is to download virtualbox. Then get a generic x86 I so of android. Install it in a virtual machine. That's also faster.
 
Upvote 0

JonPM

Well-Known Member
Licensed User
Longtime User
I understand that the code can easily be downloaded to an Android device and run there but that negates the advantages of running on a PC (like having a 32" ultra high res monitor).

IMO you should only use the PC emulator as a last resort. You are building apps aimed at mobile devices, so use an actual mobile device for testing. You don't want to waste time on a pixel you see on your high res monitor that will never be seen on a phone/tablet.
 
Upvote 0

EduardoElias

Active Member
Licensed User
Longtime User
My experience so far:

SDK emulation is really difficult to work. Too slow.

I have got 2 different tablets one that is the medium priced and is the target for the application we are working and a general very cheap chinese one.

There is nothing better than testing on the real device. Just a suggestion for the development, it could be improved the way B4a connects to the devices. The ide could have a way to keep a list of the devices and ips, because when needed to test the app in different devices it is so boring to be changing and remembering ips.

There is the VirtuaBox solution that is FAR BETTER and real fast. Redirection, just follow the step and install the LAST version of b4a-bridge. I could not make the google play works there, so you need to do that by downloading directly from a website to install or learn how to do that by adb. This VirtualBox solution will not work in a second monitor and you dont have mouse integration.

HOWEVER, it is a way to make a test when you dont have the device. I dont have one of the cellphone That i need for development. I got one from a fried for testing, I made the main part on it and changed the VirtualBox to the same screen size etc to simulate it. Gestures are only feasible on real devices. So, I can test and see there is no major problem, but final test only on the real device. No way.

And like any other new platform that we need to learn: patience. There is no magic, there is no perfec language, no perfect IDE.

Right now I am able to create a lot of new things quickly using B4A and the foruns examples and help.

Good luck !
 
Upvote 0

Informatix

Expert
Licensed User
Longtime User
I'm sure that a lot of B4A developers test their application on the device(s) they own and think that's enough. It's far from sufficient. If an app runs well on your device, that means.... quite nothing. That just means that works on YOUR device. That's why the emulator is so important. With it:
- you can test with different heap memory sizes and check if some OOM occur;
- you can display your app with different and unusual resolutions;
- you can see how your application behaves on a very slow device.

Lately, I discovered with the emulator that my demo project was running a lot faster without the hardware optimization enabled (yes, "without"). It was not obvious at all on my device because I do not own a low-end device.

That being said, you cannot really develop with the emulator. It's very difficult to simulate some user actions with it. It's just there to check some parts of your code BUT it is mandatory.

You can also buy a large range of devices. ;)
 
Upvote 0

NJDude

Expert
Licensed User
Longtime User
I'm sure that a lot of B4A developers test their application on the device(s) they own and think that's enough. It's far from sufficient. If an app runs well on your device, that means.... quite nothing. That just means that works on YOUR device. That's why the emulator is so important. With it:
- you can test with different heap memory sizes and check if some OOM occur;
- you can display your app with different and unusual resolutions;
- you can see how your application behaves on a very slow device.

Lately, I discovered with the emulator that my demo project was running a lot faster without the hardware optimization enabled (yes, "without"). It was not obvious at all on my device because I do not own a low-end device.

That being said, you cannot really develop with the emulator. It's very difficult to simulate some user actions with it. It's just there to check some parts of your code BUT it is mandatory.

You can also buy a large range of devices. ;)

You have some valid points but I disagree on the "mandatory" use of the emulator, personally, I haven't used the emulator at all, maybe a couple of times just to see how the "new" SDK looked like (when ICS was released and I didn't have any ICS device myself).

Regarding the unusual resolutions, even before designer scripts my apps scaled just fine on any device, in the beginning I just had 1 phone and now I own several devices (phones and tabs) but then again, the emulator is still collecting dust on my PC :D, in my opinion, if you are serious about writing apps, you should get at least 1 crappy device (I have 2 myself) and believe me, even if I installed some apps I've written to the emulator it would fail on one of those devices, so in short, there's no "standard" way to test your apps, there will be always one device(s) that will give you grief and just because you "tested on the emulator" doesn't mean you are good.

My humble opinion.
 
Upvote 0

Informatix

Expert
Licensed User
Longtime User
You have some valid points but I disagree on the "mandatory" use of the emulator.

Yes, I should have written "mandatory IF you don't own a decent range of devices."
I only have two devices (three soon) and I'm amazed by the numbers of things I discovered thanks to the emulator (mostly bad written code and memory usage too heavy). Lately, I realized that the roundings due to an unusual scale (corresponding to a real device I don't own) moved a bit my buttons on screen and they were not perfectly aligned.

and believe me, even if I installed some apps I've written to the emulator it would fail on one of those devices, so in short, there's no "standard" way to test your apps, there will be always one device(s) that will give you grief and just because you "tested on the emulator" doesn't mean you are good.

I still consider there are more chances that something runs well if it runs well on the emulator, than if it runs well on two or three different real devices. But that doesn't mean I trust only the emulator. Of course not. If my app runs well on the emulator, and not on a device, then it does not work for me and I must fix that.

With the emulator, I can simulate extreme conditions, really difficult to find with a real device, even crappy. It's like a car. If it works with an extremely cold climate, it should work in a temperate area where winters are mild.

The emulator is supposed to be the elementary brick. No manufacturer has added a layer on top of the OS, nor modified the OS.
 
Upvote 0

NJDude

Expert
Licensed User
Longtime User
The emulator is supposed to be the elementary brick.

I agree with you 100%
No manufacturer has added a layer on top of the OS, nor modified the OS.
Well, you have to consider the modification manufacturers do to UI for example, in some cases affects the performance of your apps, Sense in the case of HTC or any other manufacturers in some cases (you can search here some of my posts) problems I had on a particular device was due to that and not the OS, so, even if the emulator's result was fine, my app would still suck in the real world :D
 
Upvote 0

DetTigersFan

New Member
Licensed User
Longtime User
Thanks for all your suggestions and info.

I'll try that VirtualBox and Bluestacks.

I did understand that the emulators are not part of B4a.
 
Upvote 0
Top