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 ... 31 32 [33] 34 35 ... 59
481
What's New / Re: ScriptBasic for Android
« on: May 14, 2012, 08:44:47 PM »
The million dollar question is what is the IP to use in scriba?


482
What's New / Re: ScriptBasic for Android
« on: May 14, 2012, 06:35:45 PM »
I haven't tried the remote SL4A option yet and will do so tonight.

SOCKET

MODULE


483
What's New / Re: ScriptBasic for Android
« on: May 14, 2012, 05:24:35 PM »
You are going to have to do your testing in a top/down script at the moment. (no functions or subs)

I'm going ahead with building the DVM module on Ubuntu and running it from there. (until SB Android is fixed)


484
What's New / Re: ScriptBasic for Android
« on: May 14, 2012, 03:27:39 PM »
Glad to see you talking to the Droid.  :D

It might be easier and more readable if you change this code ...
Code: [Select]
PRINT #1,"{id:1,method:notify,params:[\"ScriptBasic\",\"The message for the notification\"]}"

to something like this. This follows the JSON string declaration more closely. (even though it doesn't seem to matter)
Code: [Select]
PRINT #1,"""{"id":1,"method":"notify","params":["ScriptBasic","The message for the notification"]}\n"""

Hint: Don't forget the \n at the end of your JSON messages to the server. The response contains a linefeed so you will want to use CHOMP() to remove it before passing it to JSON2SB().

485
What's New / Re: ScriptBasic for Android
« on: May 14, 2012, 12:26:57 AM »
Good News!

I found a workaround until the SB dev team solves the SUB/FUNCTION issue. SL4A allows you to access the RPC server on the phone/pad/emulator if you start the server as a public connection. This assigns an accessible IP address rather then localhost. I can use scriba that is running on my Ubuntu 64 box and control the Android device via RPC. I should be able to move the scripts (untouched) to the Android device once Armando generates a new scriba.


486
What's New / Re: ScriptBasic for Android
« on: May 14, 2012, 12:10:09 AM »
You can get the jackpal terminal from github

SL4A can be downloaded from HERE.

I don't see the FUNCTION/SUB looping issue taking too long to fix.

If your using the Linux Android emulator, I use adb to push everything to the SDCARD. (emulated with a file)


487
What's New / Re: ScriptBasic for Android
« on: May 13, 2012, 09:08:39 PM »
While testing the new DVM module, I discoved that calling a SUB or FUNCTION puts it in an endless loop. The same test programs work fine on Ubuntu scriba. I have a funny feeling the initial ARM gcc bug that Steve found has raised it's ugly head again.  >:(

488
What's New / Re: ScriptBasic for Android
« on: May 13, 2012, 02:34:51 PM »
I started building an Android SL4A module to kick things off. Don't wait too long or your favorite Facade may be taken.  ;)

Code: [Select]
' Android SL4A Interface
'
' ScriptBasic Open Source Project
'
' Contributors:
'   John Spikowski (JRS)
'
' Change Log:
'   20120513 - Initial module created

MODULE DVM

OPEN "localhost:9999" FOR SOCKET AS #1

id = 1

FUNCTION JSON2SB(json_response)
  LOCAL r,t,x,a
  r = MID(json_response,2)
  r = LEFT(r,LEN(r) - 1)
  r = REPLACE(r, "\"", "")
  SPLITA r BY "," TO t
  FOR x = 0 to UBOUND(t)
    a{LEFT(t[x],INSTR(t[x],":")-1)} = MID(t[x],INSTR(t[x],":")+1)
  NEXT
  JSON2SB = a
END FUNCTION


'**************
' PhoneFacade *
'**************

FUNCTION getPhoneType()
  LOCAL r, a
  PRINT #1,"""{"id":""" & id & ""","method":"getPhoneType","params":[]}\n"""
  LINE INPUT #1, r
  a = JSON2SB(r)
  IF a{"error") <> "null" THEN
    getPhoneType = undef
  ELSE
    getPhoneType = a{"result"}
  END IF
  id += 1
END FUNCTION


END MODULE

Untested at time of posting.

489
What's New / Re: ScriptBasic for Android
« on: May 13, 2012, 12:11:22 PM »
The following Facade's are available for ownership. Please let us know which Facade you will be working on. I will be doing random functions to help with areas that aren't well documented.

Android SL4A API

  • ActivityResultFacade
  • AndroidFacade
  • ApplicationManagerFacade
  • BatteryManagerFacade
  • BluetoothFacade
  • CameraFacade
  • CommonIntentsFacade
  • ContactsFacade
  • EventFacade
  • LocationFacade
  • MediaPlayerFacade
  • MediaRecorderFacade
  • PhoneFacade
  • PreferencesFacade
  • SensorManagerFacade
  • SettingsFacade
  • SignalStrengthFacade
  • SmsFacade
  • SpeechRecognitionFacade
  • TextToSpeechFacade
  • ToneGeneratorFacade
  • UiFacade
  • WakeLockFacade
  • WebCamFacade
  • WifiFacade


490
What's New / Re: ScriptBasic for Android
« on: May 13, 2012, 10:25:12 AM »
I'm playing around with a JSON response parser that creates a SB associative array. This is my first stab at it and may find a better way.

Code: [Select]
r = """{"error":null,"id":1,"result":"gsm"}"""
r = MID(r,2)
r = LEFT(r,LEN(r) - 1)
r = REPLACE(r, "\"", "")
SPLITA r BY "," TO t
FOR x = 0 to UBOUND(t)
  a{LEFT(t[x],INSTR(t[x],":")-1)} = MID(t[x],INSTR(t[x],":")+1)
NEXT

PRINT a{"error"},"\n"
PRINT a{"id"},"\n"
PRINT a{"result"},"\n"

jrs@laptop:~/sb/test$ scriba json_in.sb
null
1
gsm
jrs@laptop:~/sb/test$

491
What's New / Re: ScriptBasic for Android
« on: May 12, 2012, 10:46:26 PM »
Here is an example of a request / response call to the SL4A RPC server. This is opening a SB socket and sending a JSON packet to the RPC scripting server. (see attached screenshot)

The Androids API (scripting version) is fairly extensive. I would be willing to help build this interface if others contribute. I'll post a few high level functions to get the ball rolling and see what happens. My initial goal was to create a proof of concept and see if others saw promise or not. If there is no interest by others then I'll return to my IUP project and revisit this again at later time.

492
What's New / Re: ScriptBasic for Android
« on: May 08, 2012, 12:29:06 AM »
I was using SL4A r4 to run my initial tests. I found that I had to look at the properties of the RPC server to get the port it assigned. This was a PITA but this is proof of concept so I didn't mind the extra step. I recently installed SL4A r5 and it allows setting a default port for the RPC server.

What's new in SL4A - Scripting Layer for Android r5:
  • MediaRecorderFacade: If you record a video file with extension mp4 or 3gp it uses the appropriate format with the more common h264 codec.
  • SensorManagerFacade: Orientation threshold events were causing excessive entries into the Event Queue, so I have limited entries to threshold crossing both ways.
  • New media recorder option: recorderStartVideo allows you to specify video size.
  • Improved error trapping in the activityForResult functions, and now you can specify mimetype without data.
  • Changed eventWaitFor to check for events already in queue.
  • Support for full screen user interface
  • Ability to set server port to a known value (Preferences-->General-->Server Port)
  • Editor: goto line number, and ability to turn of autocomplete, set no wrap, find and replace, auto-indent
  • Added "inputType" parameter to dialogCreateInput
  • Better support for "unsupported" interpreters
  • Assorted other fixes and tweaks.

Android API

493
General Discussions / Re: sbhttpd error message
« on: May 07, 2012, 11:05:57 AM »
sbhttpd is a CGI server that run ScriptBasic scripts to generate HTML related content. It doesn't serve up images or process standard HTML documents.

I would only run standalone in an intranet application based environment. Using Apache as a front end web server provide the security, load leveling and media services. I have only used sbhttpd as a proxy application server. It's light weight (500KB) and runs as a service. (always on)


494
What's New / Re: ScriptBasic for Android
« on: May 06, 2012, 09:01:14 PM »
I was able to get ScriptBasic for Android to display an Android GUI message box (makeToast) from a SB script. This is using the SL4A (Scripting Layer for Android)

Code: [Select]
OPEN "localhost:56098" FOR SOCKET AS #1
PRINT #1,"{id:1,method:makeToast,params:[\"ScriptBasic\"]}"


495
General Discussions / Re: sbhttpd error message
« on: May 06, 2012, 07:35:41 PM »
Are you running sbhttpd as a standalone or a proxy?



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