Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - Support

Pages: 1 ... 30 31 [32] 33 34 ... 59
466
What's New / Re: ScriptBasic for Android
« on: May 24, 2012, 10:45:39 PM »
Kent,

Thanks for helping out the ScriptBasic project and your feedback is much appreciated. I would venture to say there is still more fun still to come as this project materializes. You're a OxygenBasic fan and now a SB user. You may want to try creating one of your own extension modules with O2 for SB. I hope to get a fixed (sub/function looping issue) Android version soon.

John

467
What's New / Re: ScriptBasic for Android
« on: May 23, 2012, 11:16:10 AM »
Quote
My interest as you might know currently is in game development and possible future work with robotics, the pc is still the platform for me.





iGuess you only have one Apple left in the basket.  :(

468
What's New / Re: Extention modules created with OxygenBasic
« on: May 22, 2012, 07:56:46 PM »
I created a new SQLite3 extension module DLL under Wine and it worked great when using it with the Windows version of scriba. I just downloaded and unziped the Windows version from the SQLite3 site into the \Windows\System32 directory. (Wine directory structure) This allows me to follow along with O2 and never have to leave the farm.



469
What's New / Re: ScriptBasic for Android
« on: May 22, 2012, 12:33:54 PM »
I want to thank you for being one of the first to join in on the bleeding edge of Android (remote) scripting. I think ScriptBasic has an advantage due to it's small footprint and ease of use. Allowing weekend programmers to script their devices to their needs from anywhere is bound to attract attention. It's still early and the DVM extension module in it's infancy. It would be great to see the ScriptBasic project grow with users and developers.

BTW

The SB dev team has two directions going with the ARM version of ScriptBasic. Steve is working on a native ARM compile of SB while Armando is using the Android NDK. Steve has isolated the looping FUNCTION/SUB issue to an assembler bug in the toolchain.

470
What's New / Re: ScriptBasic for Android
« on: May 22, 2012, 11:16:05 AM »
I was checking into Android emulators that support tablet size screens and physical controls. I was happy to learn that I could create an AVD  and specify device characteristics.

I found this in the Android Developer Guide that might help with GUI layout and design strategies.

471
What's New / Re: ScriptBasic for Android
« on: May 21, 2012, 06:07:21 PM »
Quote
I just look at my tablet as a media source at bedtime anymore. It is not the development toy I thought it was going to be.

Don't give up so soon. You haven't even played with the GUI yet. (fullscreen, controls, events, ...) The SQLite3 Facade is coming from what I have been told. I plan to use SB Android on a pad with an open source medical practice package as the input device.

Check out the Android Framework PDF I attached.

472
What's New / Re: ScriptBasic for Android
« on: May 21, 2012, 05:23:13 PM »
Kent,

I don't have Eclipse installed and don't want to trash my development system with installing Java and all the other dependencies that go with it. I'll take your word on the results and factor the numbers based on your Python run on your gaming netbook.

John

473
What's New / Re: ScriptBasic for Android
« on: May 20, 2012, 09:47:28 PM »
I solved the problem with REPLACE and happy with the results.

Quote
Test code grows text string by adding another string in cycle until it grows up to 4 mb. Each iteration substitutes some text. Every time string becomes 256 KiB larger program prints number of seconds passed since beginning of test.


Code: [Select]
s ="abcdefghefghefgh"
i_max =  1024 / LEN(s) * 1024 * 4

starttime = NOW
PRINT "exec.tm.sec\tstr.length\n"

gstr=""
i=0
c = 0
WHILE ( i < i_max + 1000 )
  i=i+1
  gstr&=s
  lngth=LEN(s)*i
  gstr=REPLACE(gstr,"efgh","____",undef,lngth-16)
  IF(lngth % (1024*256) = 0) THEN
    PRINT INT(NOW -starttime)," sec\t\t",(lngth/1024)," KB\n"
    c+=1
    IF c= 2 THEN GOTO finito
  END IF
WEND

finito:
PRINT "\nFinished\n"

jrs@laptop:~/sb/test$ scriba kentbench.sb
exec.tm.sec   str.length
5 sec      256 KB
34 sec      512 KB

Finished
jrs@laptop:~/sb/test$

Code: [Select]
abcd____________

abcd____________abcd____________

abcd____________abcd____________abcd____________

abcd____________abcd____________abcd____________abcd____________

I compiled the C version for a reference base. (1st MB)

jrs@laptop:~/sb/bench$ ./cstr
exec.tm.sec   str.length
2sec      256kb
6sec      512kb
17sec      768kb
34sec      1024kb
^C
jrs@laptop:~/sb/bench$

474
What's New / Re: ScriptBasic for Android
« on: May 20, 2012, 11:46:29 AM »
Don't forget to use & not + for string concatenation. It seems that imax is some kind of reserve keyword. SB doesn't support single quote for declaring strings.

Code: [Select]
s ="abcdefgh" & "efghefgh"
i_max =  1024 / LEN(s) * 1024 * 4

starttime = NOW
PRINT "exec.tm.sec\tstr.length\n"

gstr=""
i=0
c = 0
WHILE ( i < i_max + 1000 )
        i=i+1
        gstr&=s
        gstr=REPLACE(gstr,"efgh","____")
        lngth=LEN(s)*i
        IF(lngth % (1024*256) = 0) THEN
                PRINT INT(NOW -starttime)," sec\t\t",(lngth/1024)," KB\n"
c+=1
IF c= 2 THEN GOTO finito
        END IF
WEND

finito:
PRINT "\nFinished\n"

jrs@laptop:~/sb/test$ scriba kentbench.sb
exec.tm.sec   str.length
107 sec      256 KB
436 sec      512 KB

Finished
jrs@laptop:~/sb/test$

Please check the code to make sure the SB version is doing the same as the other languages.

Python test on my laptop:

jrs@laptop:~/sb/bench$ python pstr.py
exec.tm.sec   str.length
9 sec      256 kb
50 sec      512 kb

Finished
jrs@laptop:~/sb/bench$

I wonder how this would run under BaCon?

475
What's New / Extention modules created with OxygenBasic
« on: May 18, 2012, 03:24:08 PM »
I'm please to announce that Charles has updated his efforts with using OxygenBasic to create ScriptBasic DLL extension modules. (early beta) Charles created a SQLite3 extension module as an example of wrapping standard libraries with the SB extension module interface.

Code: [Select]

  declare sub SQLite3_Demo        alias "sqlite3_demo"        lib "sqlite3_mdl"
  declare sub SQLite3_ErrMsg      alias "sqlite3_errmsg"      lib "sqlite3_mdl"
  declare sub SQLite3_Open        alias "sqlite3_open"        lib "sqlite3_mdl"
  declare sub SQLite3_Close       alias "sqlite3_close"       lib "sqlite3_mdl"
  declare sub SQLite3_Exec        alias "sqlite3_exec"        lib "sqlite3_mdl"
  declare sub SQLite3_Prepare_v2  alias "sqlite3_prepare_v2"  lib "sqlite3_mdl"
  declare sub SQLite3_Step        alias "sqlite3_step"        lib "sqlite3_mdl"
  declare sub SQLite3_Column_Text alias "sqlite3_column_text" lib "sqlite3_mdl"

  SQLITE_ROW = 100

  'print SQLite3_Demo()

  hdb=0
  dberr=0
  stmt=0
  pr="DataBase Listing:\n"
  result=0
  '
  sqlite3_open("testsql",hdb)
  '
  sqlite3_exec (hdb, "CREATE TABLE demo(someval INTEGER,  sometxt TEXT);", 0, 0, dberr)
  sqlite3_exec (hdb, "INSERT INTO demo VALUES (123, 'Hello');", 0, 0, dberr)
  sqlite3_exec (hdb, "INSERT INTO demo VALUES (234, 'cruel');", 0, 0, dberr)
  sqlite3_exec (hdb, "INSERT INTO demo VALUES (345, 'world');", 0, 0, dberr)
  '
  result = sqlite3_prepare_v2 (hdb, "SELECT * FROM demo;", -1, stmt, 0)
  '
  if dberr then
    print SQLite3_ErrMsg(dberr) & "\n"
  endif
  '
  while (sqlite3_step(stmt) = SQLITE_ROW)
    pr=pr & sqlite3_column_text(stmt, 0) & " - " & sqlite3_column_text(stmt, 1) & "\n"
  wend
  '
  sqlite3_close(hdb)

  print pr
  line input w

C:\scriptbasic\test>scriba sqlite3test.sb
DataBase Listing:
123 - Hello
234 - cruel
345 - world


C:\scriptbasic\test>

476
What's New / Re: ScriptBasic for Android
« on: May 17, 2012, 09:48:23 PM »
For those wondering what a Facade is.

Quote
If you go to the SL4A API one of the things you notice is the word Facade at the end of each API.  Facade refers to a software design pattern.  A software design pattern is a generic reusable solution to a problem that occurs in a specific context in software design.  So, a facade software design pattern, represented by a facade is an object that provides a simplified interface to a larger body of code, like a class library.  As a developer you might want to do this to make the library more readable, and reduce dependencies of code on the inner workings of a given library.  In our case, the facade object is Android, and it provides a single, simple interface to the Android SDK, which is huge (relatively speaking).  The Android facade object provides a simple interface to a number of things including battery manager, camera functionality, media player, settings api, speech recognition api, web cam functionality just to name a few things.

477
General Discussions / Build your own SL4A Facade
« on: May 16, 2012, 11:14:05 AM »
Quote from: Sergey Zelenev
I need to use a closed-source proprietary Java library with my SL4A standalone project (in form of APK).
I will need to expand the SL4A RPC API for that.

What would be a good example in the source on how to do that? I'm not too strong with Java, so something very basic would be helpful.

If you have a Java background, (Pete Verhas: do you have your ears on?) one could create their own Facade scripting extension to SL4A.

Quote from: anthony prieur
You need to create your own facade class and then add it to
FacadeConfiguration.java, like:

sFacadeClassList.add(MyCustomFacade.class);

FacadeConfiguration.class needs to be put out of script.jar and add it
to your project, see e.g.:
HERE

Simple facade you can use as base for yours:
HERE

478
What's New / Re: ScriptBasic for Android
« on: May 14, 2012, 11:14:59 PM »
Finally!

I ran into a post on some forum and it said that the RPC server only listens on the loopback (127.0.0.1) port under Linux. That was the hint that got me pointed in the right direction. I still had to do the adb port forwarding. I have the default sever port set to be 9999. (pref.) I issue the following adb command in my Ubuntu terminal.

jrs@laptop:~$ adb forward tcp:9999 tcp:9999

This way I don't have to touch a thing if I'm running remote or on the sdcard.

Code: [Select]
OPEN "localhost:9999" FOR SOCKET AS #1
PRINT #1,"""{"id":1,"method":"getPhoneType","params":[]}\n"""
LINE INPUT #1, r
PRINT r

jrs@laptop:~/sb/test$ scriba phonetype.sb
{"error":null,"id":1,"result":"gsm"}
jrs@laptop:~/sb/test$


I can see an advantage of running a SB script on a desktop that accesses a MySQL or ODBC database and updates an Android phone or pad with new contacts or even SQLite DBs on the device. The concept of write once, run anywhere is leaning toward using scripting language solutions. Python is in the lead but has a size and dependency downside. I hope the simplistic nature of traditional Basic and the versatility to run anywhere will give ScriptBasic a purpose on a mass scale.

479
What's New / Re: ScriptBasic for Android
« on: May 14, 2012, 10:23:40 PM »
Under Ubuntu Linux running the Android emulator provided with the SDK, it just hangs on the OPEN for both private (with port forwarding) and public connections.

I have a message out on the Android Scripting list asking Robbie what's up.

480
What's New / Re: ScriptBasic for Android
« on: May 14, 2012, 09:17:50 PM »
Get the latest development release, 5x18.

http://code.google.com/p/android-scripting/wiki/Unofficial

This will show the IP and not ::1%1.

The server hangs on the OPEN from scriba on Ubuntu using the IP:PORT given. (public server)


Pages: 1 ... 30 31 [32] 33 34 ... 59