Confusing instruction to use web IDE, and app doesn't run.

199 views
Skip to first unread message

T. Lee

unread,
Apr 9, 2021, 4:11:04 PM4/9/21
to DroidScript
I got the DroidScript app from http://androidscript.org/apk/. And, am attempting to use the online IDE.

Following instructions at droidscript.org, I went to http://androidscript.org/ide/. Then, following those instructions, I tapped the Wifi icon and got a message with instructions to type an address into my web browser. The address is the IP address of my phone at port 8088. Using the given password, I successfully connected (green Wifi icon) to the IDE on the phone with my browser and tapped OK on the phone.

The instructional message cleared and I was given the IP address of my PC, which http://androidscript.org/ide/ says I should enter there and click Connect. Doing that gives, "Connection Error. Please check the IP address and try again.

I don't understand why I would put the IP address of my PC into that form, to connect from my PC ... to my PC.  ??


Anyway, I got connected (I think) and am following the tutorial at http://droidscript.org/tutorials/my-first-app-part-1/. I got to where it says, "Click the Run button."

The app doesn't run on the phone. Nothing happens that I can tell (except that the Run button is 'sunken' and clearly clicked). The DroidScript app still shows the IP address of my PC, and no other apps launch. (Tapping that IP address, triggers a confirmation dialog asking if I want to disconnect.) Is this because I didn't follow instructions correctly? What am I missing?


BTW, the Wiki link gives: HTTP ERROR 500

Steve Garman

unread,
Apr 10, 2021, 4:15:38 AM4/10/21
to DroidScript
A couple of things to know about the WiFi IDE

Firstly you don't need to go to http://androidscript.org/ide/ An alternative is to tap the wifi icon and follow the instructions to type the address straight into your browser. 

However you connect, your phone will then display a message showing the IP address of the PC it is connected to. You don't need to know that address but  you should leave that message displayed on the screen as its main purpose is to stop you opening the editor on your phone at the same time the IDE is in use. Unpleasant things happen if you have both open simultaneously.

When using the WiFi IDE to work on projects on my phone, the first thing I always do is to open the debug tab on the right hand side. It keeps me informed of what is going on and stops me wondering why nothing happened when I press the run button

It is also worth keeping an eye on the green connection icon at the top right of the WiFi IDE. If that icon changes to white, you have lost connection to your phone and you may be able to restore it by clicking the same connection icon

T. Lee

unread,
Apr 10, 2021, 2:33:52 PM4/10/21
to DroidScript
Thank you for that info, Steve.

I think http://androidscript.org/ide/ should just say, "Open DroidScript on your phone, tap the WiFi icon, and follow the instructions." That's it. Otherwise, the instructions conflict and are confusing. BTW, even entering the IP address and port number of my phone in that form gave me the very same Connection error message.

At any rate, I've found out why the app won't run. The Debug tab was helpful (thank you) in that it showed me the click on the Run button was indeed recognized by the IDE. The content in that tab totally cleared when I clicked the button, but showed no errors, or anything FTM, whatsoever.

Thinking it might be a firewall issue, even though it should not be, I fired up Wireshark and captured the packets between my desktop and the phone. I see the IDE sending the Run command: GET /ide?cmd=run&prog=MyFirstApp&_=1618076876934 HTTP/1.1

The response is:
HTTP/1.1 500 No virtual method getSystemService(Ljava/lang/Class;)Ljava/lang/Object; in class Landroid/content/Context; or its super classes (declaration of 'android.content.Context' appears in /system/framework/framework.jar)

The IDE does not catch and inform of that error.

Now, since DroidScript was not on the Play Store, I have no idea what the system requirements are. I am running Android 5.1.

T. Lee

unread,
Apr 10, 2021, 3:45:37 PM4/10/21
to DroidScript
Okay, it's a version issue. I installed DroidScript_206.apk on a device with Android 9, and it works. That brings me to the following question.

What version of DroidScript, if any, will work on my Android 5.1 device?

Steve Garman

unread,
Apr 10, 2021, 4:20:24 PM4/10/21
to DroidScript
Some people have trouble using versions newer than 1.98 on lollipop devices

If you are going to use that, you should not try to upload APK built with it to Google Play because it will not be accepted

You can, however develop on 1.98 then copy an SPK to your Android 9 device and build the APK there

Steve Garman

unread,
Apr 10, 2021, 4:28:47 PM4/10/21
to DroidScript
Sorry I shouldn't write that sort of thing from memory without checking

I meant to say:
Some people have trouble using versions newer than 1.80

Steve Garman

unread,
Apr 10, 2021, 4:40:33 PM4/10/21
to DroidScript
The other thing that's worth checking in 5.1.1
Go into Google Play and nake sure that your "System Webview" app is up to date

T. Lee

unread,
Apr 10, 2021, 5:08:02 PM4/10/21
to DroidScript
Steve, I missed your messages while I was looking at the APK archive files for versioning info and decided to try downgrading to one major version less. I am happy to report that v1.80 does indeed work on my Android 5.1 device. But, even with System Webview updated, 2.06 still does not.

That's okay. I can work with that. My intention is not to create apps (yet) for the Play Store, but was hoping to re-purpose and old device for a personal home automation project.

Thank you for your help.

One last totally off-topic question:
At the bottom of the Debug tab it says, "Type here to run code inside your App. Use ? to see contents of".
The remainder of the sentence overflows invisibly. Is it, to see the contents of variables or objects?

Reply all
Reply to author
Forward
0 new messages