FORUMS
Remove All Ads from XDA

[APP] WearShell

89 posts
Thanks Meter: 86
 
By joschi70, Member on 11th October 2014, 05:43 PM
Post Reply Email Thread
Having a LG G Watch for a while I thought that it would be interesting to run code directly on the watch without having to create an APK. Sometimes I just wanted to run some code snippets on the watch and view the result instantly.
Creating a complete project, compiling and deploying the APK on the Wear device is quite time consuming and somewhat annoying.

I tried to write an app to execute BeanShell code directly on the Wear device. This is all experimental and the possibilities are quite limited compared to an regular app, but for an execution of some code snippets that seemed to be a good idea.
The result is Wear Shell, an app that consists of a mobile and a Wear part. The mobile part moves the code for execution to the smart watch, collects the result and passes it to the calling application.
So I hope owners of an Android Wear smart watch have fun with the app and find it as interesting as I did to explore things from the perspective of a watch.

The complete blog post can be found here: Wear Shell - Exploring Android Wear

Now also available on Google Play.

Current Version
0.5.0

Download
WearShell APK

Extensions
Additional BeanShell Commands

Screenshot
WearShell Web Interface with Wear System Info
The Following 8 Users Say Thank You to joschi70 For This Useful Post: [ View ] Gift joschi70 Ad-Free
 
 
14th October 2014, 08:33 PM |#2  
Member
Thanks Meter: 17
 
More
Does this run java code only?


I had an idea of displaying web view info...like some nfl scores and stats think that be pretty sweet

After reading I think I found my answers, still pretty cool
15th October 2014, 11:23 PM |#3  
Senior Member
Thanks Meter: 295
 
More
Thank you so much. You don't understand what a pain in the ass it is to have to get on my laptop every time I want to execute a simple command in the watch.
18th May 2015, 11:39 AM |#4  
Member
Thanks Meter: 22
 
More
I just realized how great this project was, yet so long time it has raised not much attention... The barrier for most readers may be the complicated JAVA source codes, where a lot of people may choose easier Python when using sl4a.

well, I just started as a newbie. My little suggestion is to add some notification push examples (main function of watch isn't it?) to attract more people.
For example I wrote a toast
import android.widget.Toast;
Toast.makeText(context, "message", Toast.LENGTH_SHORT).show();

I am also wondering if it is possible to popup or send a image to watch..

I need some time to understand the intent. But honestly I will appreciate if anyone can tell me how to call it through "am" or "tasker intent".
Besides, is there an option to hide the running popup?
18th May 2015, 07:13 PM |#5  
Member
Thanks Meter: 22
 
More
After half day of trying, I found it hard to go on. The main reason is there lacks a tutorial explaining what commands and libraries are available and what are not.
For example, the desktop version I can use classBrowser() but no longer available in wear (apparent for a window, but what about others..).
For example, I can import android.widget.Toast but cannot import android.support.v4.app.NotificationCompat.Wearable Extender; Besides, the error output is no so user-friendly that error only shows when later calling.
As a beginner should not use such an ineffective way that I try every command/library to see if there is an error.
Any resources for helping?
25th May 2015, 08:30 AM |#6  
joschi70's Avatar
OP Member
Thanks Meter: 86
 
More
Androd Wear supports almost the complete Android API.
Here are the exceptions:
  • android.webkit
  • android.print
  • android.app.backup
  • android.appwidget
  • android.hardware.usb

The Wear app does not include any support library, so android.support.v4 classes are not available.
Nevertheless you should be able to use notifications the same way you do on a normal Android device.

Here is an example:

Code:
import android.app.Notification;
import android.content.Context;

noti = new Notification.Builder(context)
         .setContentTitle("Title")
         .setContentText("Text")
         .setSmallIcon(com.android.internal.R.drawable.emo_im_cool)
         .build();
​
notificationManager = context.getSystemService(Context.NOTIFICATION_SERVICE);
notificationManager.notify(3, noti);​
30th May 2015, 07:37 PM |#7  
Senior Member
Thanks Meter: 138
 
More
I can't get exec intent to work. I tried Tasker, am and custom app and none seem to work.

Code:
        Intent intent = new Intent("de.fun2code.android.wear.shell.EXEC");
        intent.putExtra("bsh", "source(\"/sdcard/alwaysoff.bsh\");");
        sendBroadcast(intent);
(File is there, if I execute same exact code via web interface it works.)

Any ideas?
2nd June 2015, 04:02 PM |#8  
Senior Member
Thanks Meter: 7
 
More
I've noticed that WearShell only works when my phone's screen is on and unlocked. Thanks to qingtest and matejdro I have Tasker toggle theater mode in certain conditions, but it doesn't work if my phone's screen is off or it's locked. Secure Settings can allow Tasker to turn on the screen, but I haven't found anything to swipe at the lock screen to unlock it. That being the case, it'd be nice if WearShell could send the command while the phone is locked.
3rd September 2015, 03:49 AM |#9  
Senior Member
Flag Saudi Arabia, Jeddah
Thanks Meter: 62
 
More
@joschi70 I followed the instructions in this topic http://forum.xda-developers.com/show....php?t=3098425 and I am using Tasker to send an intent. However, I noticed that sometimes the command is not sent to the watch if the phone is off and when I open the phone I find a message "Communicating with Wear Device".


Click image for larger version

Name:	uploadfromtaptalk1441248503091.jpg
Views:	656
Size:	223.4 KB
ID:	3460848

Posted via Tapatalk
4th September 2015, 03:59 AM |#10  
joschi70's Avatar
OP Member
Thanks Meter: 86
 
More
The Result Intent requires the phone to be unlocked.
I'm currently working on a new version that supports Broadcasts which should hopefully solve this issue.
The new version will support background service, an option to start the service on boot and an enhanced web interface.
Hope I can finish the new version in a couple of weeks.
9th September 2015, 04:24 PM |#11  
joschi70's Avatar
OP Member
Thanks Meter: 86
 
More
WearShell 0.4 is available for download.
The Following User Says Thank You to joschi70 For This Useful Post: [ View ] Gift joschi70 Ad-Free
Post Reply Subscribe to Thread

Tags
android wear

Guest Quick Reply (no urls or BBcode)
Message:
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes