Android Spinner and Math

The place to discuss anything and everything about running your LiveCode on Android

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
RevMagi
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 8
Joined: Wed Mar 13, 2013 5:24 am

Android Spinner and Math

Post by RevMagi » Tue Mar 26, 2013 9:38 pm

Hello Everyone,

I am new to LiveCode but very excited. I currently have a few apps in the Play Store which were developed in Flash Builder (Flex and Air). I like the process there but action scripting can be a pain for some of the applications I would like to develop. I am working on a port of a current app which I would like to expand. Currently I am looking for some examples on being able to use two Spinners to select values which will have simple math performed on then and then present the answer to the user. I am looking at mergeExt and other code options for the spinner but seems to be a bit out of the normal drag and drop option I am use to.

Again, I am not looking for anyone to build the app for me, but pointers in the right direction would be extremely appreciated.


Regards,

RevMagi

Simon
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3901
Joined: Sat Mar 24, 2007 2:54 am

Re: Android Spinner and Math

Post by Simon » Tue Mar 26, 2013 10:36 pm

A spinner is a dropdown list or more like the date picker on iPhone? e.g.
http://lessons.runrev.com/s/lessons/m/4 ... -an-iphone
For dropdowns you can use the LC built in ones or roll your own (which you probably want to do). By grouping buttons you can move them in and out of view as you like.
For the slot machine type look up mobilePickDate, odd that that control could be used for more than dates I wonder why it's been set only for dates?

Simon
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!

RevMagi
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 8
Joined: Wed Mar 13, 2013 5:24 am

Re: Android Spinner and Math

Post by RevMagi » Wed Mar 27, 2013 3:47 am

Thanks for your response...I had looked at that lesson as well. That is the spinner look I am wanting to achieve in both IOS and Android. I have a small niche app which is geared towards the jewelry group, it is a calculator and I give it away free. Though I would like to add other features which could be used as up-sell items in the app over time.


Now I am playing with issues of my simulators not working and my Android phone is 4.2.2 so having same issues as others with it now showing anything but the demo splash screen. It will come together.... I just need to keep playing and watching all the video's. I also bought the LiveCode book. Like anything worth doing, it will just take getting use to the way things work.


RevMagi

RevMagi
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 8
Joined: Wed Mar 13, 2013 5:24 am

Re: Android Spinner and Math

Post by RevMagi » Tue Jun 11, 2013 1:47 am

Hello,

I have been busy with my day job and have not had a lot of time to play around with LC but am coming back to it. I am attaching an image of one of my utility apps I want to port over to LiveCode and expand its ability to add more feature. I am looking for pointers on how to build out the picker like this for IOS and Android. Thanks in Advance.


Revmagi
Attachments
Screen Shot 2013-06-10 at 8.43.15 PM.png
Screen Shot 2013-06-10 at 8.43.15 PM.png (64.49 KiB) Viewed 10123 times

Simon
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3901
Joined: Sat Mar 24, 2007 2:54 am

Re: Android Spinner and Math

Post by Simon » Tue Jun 11, 2013 6:38 am

Hi RevMagi,
This looks great!
As I said above I don't get why the scroll wheel isn't used for more things.

Here, Bernd did a bunch of work on this:
http://forums.runrev.com/phpBB2/viewtop ... =49&t=6005
http://forums.runrev.com/phpBB2/viewtop ... f=9&t=1381
http://forums.runrev.com/phpBB2/viewtop ... f=5&t=5870
Not sure which one of those is his latest.

Simon
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!

bn
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 4163
Joined: Sun Jan 07, 2007 9:12 pm

Re: Android Spinner and Math

Post by bn » Tue Jun 11, 2013 9:25 pm

Hi,

@Simon, thanks for remembering that. I had forgotten that we "met" on the forum in that thread.

I did the Spinner or Picker or scroll wheel or what you want to call it way back before LiveCode/Revolution could access the native thing. It is pure Livecode with graphics, gradients and field. When the native thing came along I stopped developing it.

That said if you like the basic functionality it is easily adaptable to a different layout etc.

One thing on iOS it the endless scrolling stops at the top and bottom of the list and then you can scroll on. So it is not completely seemless.

But on the other hand for some uses (e.g. lists) it is actually not bad to have a short stop since it reminds you of the non-endless state of the list.

As it turns out someone currently develops an iOS app using the scroll wheel. And using unicode to feed the scrolling field. And finds the performance quite acceptable.

So if you are interested I could provide a more current version / adapted version.

Kind regards
Bernd

RevMagi
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 8
Joined: Wed Mar 13, 2013 5:24 am

Re: Android Spinner and Math

Post by RevMagi » Wed Jun 12, 2013 12:44 am

Hello,

I just saw both responses to the post, I am going to check them out right away. I am interested in both custom process as it sounds like a good thing to understand, as well as how to use the native control... I must not have found that tutorial yet. I did buy the book on Livecode(printed edition), just waiting for it to be delivered. I am also interested in being able to feed data to the objects as it may provide a better solution. This example pictured was built in Flash Builder and built for Adobe Air. It works well but I have a tab for each different type of measurement.

Thanks again.

RevMagi
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 8
Joined: Wed Mar 13, 2013 5:24 am

Re: Android Spinner and Math

Post by RevMagi » Fri Jul 19, 2013 12:13 am

I finally had some time off from traveling to download and play with the code examples for the spinner. I clearly have a long ways to go before I can even be in the ballpark you are in creating the spinner. You did an awesome job and they are just amazing. It would be awesome if that could be added as an object in the UI so that is was easily available to everyone.

I am going to see if I can figure out how to easily move it over into the project I am working on. Then I will figure out how to process some arithmetic.

Thanks for the fine examples.


RevMagi

bn
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 4163
Joined: Sun Jan 07, 2007 9:12 pm

Re: Android Spinner and Math

Post by bn » Mon Jul 22, 2013 12:11 pm

Hi RevMagi,

thank you for your kind words.

Incidentally the "spinner" was used in this iOS app
https://itunes.apple.com/hk/app/cypriot ... n-mpt=uo=2

which was released just recently. It is an app that lists towns and villages in Cyprus with their Greek and Turkish names. It also shows the villages on a map. It is an attempt to further understanding of the two parts of Cyprus.

If you run into problems with the spinner just write back. Remember, if you want to load the spinner with a list you have to load it with the list doubled. E.g. you want to spin a list of 30 entries you append the 30 entries to the original list and then load the spinner. This is to make shure it can scroll "endlessly". The values reported back by the spinner in the messages it sends refer to the single list.

Kind regards
Bernd

Post Reply