Read from process !!

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

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

carloz
Posts: 6
Joined: Mon Dec 26, 2011 4:45 am

Read from process !!

Post by carloz » Mon Dec 26, 2011 4:51 am

hi all,

Have been trying to open a process, and read a line from it.. the code/function worked fine on my windows laptop , but the same dosent work on android

heres what i am doing.


on mouseUp
put specialFolderPath("engine") into tSndPath
put tSndPath into myDirPath
split myDirPath using "/"
put the last line of the keys of myDirPath into myLastElement
delete variable myDirPath[myLastElement]
combine myDirPath using "/"
put myDirPath & "/other_app_here.apk" into tSndPath
launch tSndPath
open process tSndPath for read
read from process tSndPath until end
put tSndPath into field "Field"
end mouseUp


in the above code, the path to other_app is correct, but neither the "launch" nor "open process" execute other_app.apk.
can someone plz help to figure out whats wrong ?

regards
carloz

sturgis
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 1685
Joined: Sat Feb 28, 2009 11:49 pm

Re: Read from process !!

Post by sturgis » Mon Dec 26, 2011 4:47 pm

While I suspect what you're trying to do is not allowed, I wanted to point out a couple things.

First, from what I understand there is no absolute guarantee that key elements will always come out the same order they went in. Something to watch for. Also, if all you want to do is remove the last item after the slash, its much easier to

put whateverMyPathIs into tPath
set the itemdelimiter to "/"
delete item -1 of tPath

Then to tack on the replacement item you can
put "/yourapptorun" after tPath

Or instead of deleting item -1 of tpath you can
put "yourapptorun" into item -1 of tPath -- will just replace the whatever is currently in that item position. Still must set the itemdelimiter.

Still pretty sure you don't have rights to start another app that way but will mess around with it some here to see if there is a way. Hopefully someone else will have a definitive answer.

carloz
Posts: 6
Joined: Mon Dec 26, 2011 4:45 am

Re: Read from process !!

Post by carloz » Tue Dec 27, 2011 2:53 am

hi ,

thnx for replying. what i am trying to do is to execute a barcode scanner app on my phone from livecode and get the result.
if you say this might not be allowed, how else can we do it?

regards
carloz

sturgis
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 1685
Joined: Sat Feb 28, 2009 11:49 pm

Re: Read from process !!

Post by sturgis » Tue Dec 27, 2011 3:10 am

Hmm. Not sure. One option might be to see if there is some public domain android code for scanning barcodes that could be converted to a livecode external. (don't know anything about making externals for android though so i'm yet again clueless on this front) If you CAN figure out how to make an external and library that will do this I'm betting you could sell it pretty well at the runrev store.

The other thing i'm wondering is how the barcode scanner functions. A while back I dealt with some scanners that were basically glorified keyboards. Connect em, go to the field or whatever where you want to capture a barcode, hit the button and viola' standard keycodes, so the barcode number appears in the field. But this was not on a phone, not android, was on a winpc and the scanner hooked up with a ps2 pass through dongle. (did I mention this was a while back? I should have said QUITE a while back)

While I doubt I can help beyond guesswork, what scanner are you using? Bluetooth? Physical connection to your phone? Do you know if its doing serial communication through the bluetooth and/or physical connection? If its serial you might be able to write some handlers to tackle this (IF serial comm is supported by livecode for android so far...) You've got me curious now though so please share what you discover!

carloz
Posts: 6
Joined: Mon Dec 26, 2011 4:45 am

Re: Read from process !!

Post by carloz » Tue Dec 27, 2011 6:01 am

hi,

am using the camera phone for the scanning. have a look at the zxing scanner on android market. also look at lowprice on android market. what lowprice does is it launches zxing scanner and uses the value returned by it to search for books.

am trying to achive the same.

regards
carloz

sturgis
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 1685
Joined: Sat Feb 28, 2009 11:49 pm

Re: Read from process !!

Post by sturgis » Tue Dec 27, 2011 3:48 pm

Ok. Am going to read up. No guarantee, this is outside my comfort zone but if I figure anything out i'll post here.

carloz
Posts: 6
Joined: Mon Dec 26, 2011 4:45 am

Re: Read from process !!

Post by carloz » Tue Dec 27, 2011 3:57 pm

thnx mate... am doing the same. il post here too if i find a solution..
hope one of the moderators see this and have a way out

regards
carloz

Klaus
Posts: 13846
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: Read from process !!

Post by Klaus » Tue Dec 27, 2011 4:05 pm

Hi guys,

"open/read from process" is currently NOT supported on Android (yet?)!
A quick look at the dictionary entry for "read from process" revealed this truth to me 8)


Best

Klaus

sturgis
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 1685
Joined: Sat Feb 28, 2009 11:49 pm

Re: Read from process !!

Post by sturgis » Tue Dec 27, 2011 4:23 pm

Hey Klaus,
do you know if there is a method to build android externals yet? So that this barcode library could maybe be used that way? Not that THAT is within my realm of ability either, but maybe someday.

Klaus
Posts: 13846
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: Read from process !!

Post by Klaus » Tue Dec 27, 2011 5:36 pm

Hi Sturgis,

sorry, neither do I develop for Android nor do I have the slightest idea about externals
(or other programming languages besides Livecode at all!) 8)


Best

Klaus

carloz
Posts: 6
Joined: Mon Dec 26, 2011 4:45 am

Re: Read from process !!

Post by carloz » Tue Dec 27, 2011 5:43 pm

hey klaus,

so using livecode , how does one open process and read from it? for any OS .. android,IOS etc


regards
carloz

Klaus
Posts: 13846
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: Read from process !!

Post by Klaus » Tue Dec 27, 2011 5:58 pm

Hi Carloz,

check the dictionary entry for "open process" and "read from process".
This is currently only supported on Mac/Win/Linux! No iOS or Androind support so far!


Best

Klaus

carloz
Posts: 6
Joined: Mon Dec 26, 2011 4:45 am

Re: Read from process !!

Post by carloz » Tue Dec 27, 2011 6:03 pm

oops... my bad.. :(

thnx klaus .. any way to do intents ?\


regards
carloz

sturgis
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 1685
Joined: Sat Feb 28, 2009 11:49 pm

Re: Read from process !!

Post by sturgis » Wed Dec 28, 2011 2:27 am

Ok thx much anyway. Livecode is pretty amazing and getting better all the time. I'm so tickled that I can actually get stuff done with LC that i'm not much interested in the other languages anymore either.
Klaus wrote:Hi Sturgis,

sorry, neither do I develop for Android nor do I have the slightest idea about externals
(or other programming languages besides Livecode at all!) 8)


Best

Klaus

monte
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 1564
Joined: Fri Jan 13, 2012 1:47 am
Contact:

Re: Read from process !!

Post by monte » Sat Mar 10, 2012 10:37 pm

Hi folks

As soon as there is an android eternal sdk I will release mergZXing for android.

Cheers

Monte
LiveCode User Group on Facebook : http://FaceBook.com/groups/LiveCodeUsers/

Post Reply

Return to “Android Deployment”