It is currently Wed Jun 28, 2017 12:19 pm



Welcome
Welcome to rfobasic

You are currently viewing our boards as a guest, which gives you limited access to view most discussions and access our other features. By joining our free community, you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content, and access many other special features. In addition, registered members also see less advertisements. Registration is fast, simple, and absolutely free, so please, join our community today. **You are not required to provide truthful information to any registration questions. Be whomever you wish to be.!


Post new topic Reply to topic  [ 17 posts ]  Go to page 1, 2  Next
Author Message
 Post subject: Starting first serious project...a few questions...
Unread postPosted: Mon Mar 27, 2017 5:21 am 
Offline

Joined: Tue Apr 23, 2013 1:54 am
Posts: 38
I have been dabbling with BASIC! for several years and generally keeping an eye on the forum but never used it for anything more than quickie Bluetooth experiments.

Now I have decided to use BASIC! for a tablet-based GUI for my microcontroller-based project.

I prefer to create my GUI elements in a graphics package, as they can be much sexier than trying to draw them with code.
The method that I am currently experimenting with is to load a bunch of .png images, draw them and then hide the ones I don't yet want just prior to rendering. Then I just hide/show the images as needed.

1) Is this a safe/recommended practice or should I be expecting a problem with memory?
2) The .png files are currently loaded from a directory. When I get around to creating an .apk, can the bitmaps be incorporated, somehow?

Opinion: I have been using B4A for the past five years and I like it very much but as my apps are pretty much glitzy GUIs, I find that BASIC! is more than capable and MUCH faster to develop with. Many thanks to the developers of BASIC! and the 3rd-party tools. I shall be hitting the "Donate" buttons without hesitation. I just wish Marc had one.

Regards,

Tinine


Report this post
Top
 Profile  
 
 Post subject: Re: Starting first serious project...a few questions...
Unread postPosted: Mon Mar 27, 2017 10:48 pm 
Offline
User avatar

Joined: Sat Oct 04, 2014 5:45 am
Posts: 653
Hi Tinine,

Try RFODESIGNER rfodesigner-t3869.html
and many questions you might have will be answered by just inspecting the
auto generated code. RFODESIGNER is made for GUI based aps.
Your APK will also be created for you, ready to upload/install on your phone.

Regards
Emile

_________________
Download and tutorial for RFODESIGNER
https://sites.google.com/site/rfodesigner/


Report this post
Top
 Profile  
 
 Post subject: Re: Starting first serious project...a few questions...
Unread postPosted: Tue Mar 28, 2017 12:28 am 
Offline

Joined: Wed Feb 20, 2013 3:25 pm
Posts: 423
Location: Italy
Hi,

Another powerful option is to use GW Lib:
http://rfobasic.freeforums.org/gw-lib-f27.html

Luca


Report this post
Top
 Profile  
 
 Post subject: Re: Starting first serious project...a few questions...
Unread postPosted: Tue Mar 28, 2017 2:17 am 
Offline

Joined: Tue Apr 23, 2013 1:54 am
Posts: 38
Thanks guys,

Oh I am aware of the above products which are both VERY impressive, BUT my project is "paid for" and I really don't have time for a learning curve. I am obsessed with GUI response speed and very high quality UI elements. I have a Photo-Shop created library of GUI elements such as buttons (up-state/down-state), LEDs, textured backgrounds, 3D frames for text input etc. and using show/hide makes these instantly appear/disappear. I guess I shied away from BASIC!, in the past because of the interpreter's performance but this method leaves nothing to be desired.

Now, considering my lack of experience with the above mentioned products, it's probably premature to make the following comments which are based on very quick observations.

@RSA I came across a code snippet that you posted (can't find it right now), that I assumed to be generated code and it appeared to me that many "If-Then" evaluations were being made on the same variable. If the first evaluated "true", all other options would still be evaluated and IIRC, there were many occurrences of the same variable being assigned the same value. Once again, I only glanced at this and it could be my lack of understanding of what was happening.

@luca I became excited with GW Lib's themes, at first, but even on my fastest Android device, some of the elements are too sluggish for my liking.

I am serious about BASIC!, now, only because I appear to have found a method that results in no perceptible lag to the user.

Regards,

Tinine


Report this post
Top
 Profile  
 
 Post subject: Re: Starting first serious project...a few questions...
Unread postPosted: Tue Mar 28, 2017 3:27 am 
Offline
User avatar

Joined: Sat Oct 04, 2014 5:45 am
Posts: 653
Tinine wrote:
that I assumed to be generated code and it appeared to me that many "If-Then" evaluations were being made on the same variable. If the first evaluated "true", all other options would still be evaluated and IIRC, there were many occurrences of the same variable being assigned the same value.

I think you are making a mistake with the above statement.

First go to the RFODESIGNER website and download the examples and install the APK on your phone. Every example has an APK included for quick testing. A good example would be the "iPhone Calculator" to experience the speed on a relative large program. You will be amazed I think. Then you inspect the code. This example uses one bitmap with various touch regions on it. In other words you could take a photo of something and display that bitmap and select specific regions to respond to a touch. Same could be done with your custom smaller individual bitmaps and instead just use a touch on the bitmap versus a region on it. Basic! is much more powerful than meets the eye at first glance.

If you can use the visual VB IDE to program simple button tasks then RFODESIGNER is a breeze.

Good luck
Emile

_________________
Download and tutorial for RFODESIGNER
https://sites.google.com/site/rfodesigner/


Report this post
Top
 Profile  
 
 Post subject: Re: Starting first serious project...a few questions...
Unread postPosted: Tue Mar 28, 2017 3:49 am 
Offline

Joined: Tue Apr 23, 2013 1:54 am
Posts: 38
You are absolutely right. I need to try this before I go any further.

Many thanks, I will keep you posted.

Regards,

Tinine


Report this post
Top
 Profile  
 
 Post subject: Re: Starting first serious project...a few questions...
Unread postPosted: Tue Mar 28, 2017 8:57 am 
Offline

Joined: Tue Apr 23, 2013 1:54 am
Posts: 38
RSA wrote:

If you can use the visual VB IDE to program simple button tasks then RFODESIGNER is a breeze.

Good luck
Emile


Thus far, I can only say that it's been an exercise in frustration.

I created a main screen then imported one of my .png bitmap buttons using the "Bitmap" selector. My bitmap appeared but its actual 120 X 120 shape was changed to 150 X 50.

I went to set this to the correct values at the top-left of the IDE and it wouldn't let me select these values. I could select other values but not my bitmap size/location.

You can't send directly to the Android device for testing? I am currently using the BASIC!-launcher and the work-flow has to the best that I've experienced since QuickBASIC 4.5

Also, in my case, I don't need the app to figure out the screen size/resolution as I am using a specific tablet for the project and I customize it enough that the end-user will not simply be able to replace it so I can hard-code dimensions and locations of the various elements, keeping the code to a minimum.

Regards,

Tinine


Report this post
Top
 Profile  
 
 Post subject: Re: Starting first serious project...a few questions...
Unread postPosted: Tue Mar 28, 2017 9:10 am 
Offline

Joined: Tue Apr 23, 2013 1:54 am
Posts: 38
This the sort of thing that I am doing...


Attachments:
File comment: An example of my GUIs
Screenshot_2013-08-31-14-26-06.png
Screenshot_2013-08-31-14-26-06.png [ 410.06 KiB | Viewed 296 times ]
Report this post
Top
 Profile  
 
 Post subject: Re: Starting first serious project...a few questions...
Unread postPosted: Tue Mar 28, 2017 10:51 am 
Offline
User avatar

Joined: Wed Jul 10, 2013 8:11 am
Posts: 363
Tinine wrote:
I prefer to create my GUI elements in a graphics package, as they can be much sexier than trying to draw them with code.
The method that I am currently experimenting with is to load a bunch of .png images, draw them and then hide the ones I don't yet want just prior to rendering. Then I just hide/show the images as needed.

1) Is this a safe/recommended practice or should I be expecting a problem with memory?
2) The .png files are currently loaded from a directory. When I get around to creating an .apk, can the bitmaps be incorporated, somehow?



In my opinion
* Create so many static elements as possible into a background screen file (.png).
* Create a data table(s) with bitmap positions, touch areas etc.
* Load this background on start.
* Load all touch and check bitmaps
__If you load a bitmap you can use the automatic unique bitmappointer or in your case a defined one started with 1 to n from your data table.
__You get only in trouble if you load bitmaps again an again without deleting them before.
* Gr.modify is your best friend

Last but not least, you are able to store the bitmaps and other data in an APK.

/ Gregor


Report this post
Top
 Profile  
 
 Post subject: Re: Starting first serious project...a few questions...
Unread postPosted: Tue Mar 28, 2017 12:04 pm 
Offline
User avatar

Joined: Sat Oct 04, 2014 5:45 am
Posts: 653
Tinine wrote:
I created a main screen then imported one of my .png bitmap buttons using the "Bitmap" selector. My bitmap appeared but its actual 120 X 120 shape was changed to 150 X 50.


Drag the borders with your mouse to resize. It snaps by default to 5 pixels. Bottom right you can change the snap size to requirements.

Quote:
I went to set this to the correct values at the top-left of the IDE and it wouldn't let me select these values. I could select other values but not my bitmap size/location.

The mouse does the work for you.

I suggest to load your big bitmap and then overlay a TchRect Object which is an invisible touch region placed over your bitmap that will act as an invisible button on your big bitmap.

I used your bitmap and put together a quick touch region on the buttons 1/2/3
Install the APK and test
Attachment:
Tinine.apk [897.45 KiB]
Downloaded 5 times

Full source code
Attachment:
aa.zip [1.25 MiB]
Downloaded 5 times

Screenshot in RFODESIGNER
Attachment:
Untitled.png
Untitled.png [ 186.15 KiB | Viewed 244 times ]

Emile

_________________
Download and tutorial for RFODESIGNER
https://sites.google.com/site/rfodesigner/


Report this post
Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 17 posts ]  Go to page 1, 2  Next


Who is online

Users browsing this forum: No registered users and 4 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
suspicion-preferred