[DEV] Create custom home screen pages for the Pace

Search This thread

Quinny899

Recognized Developer / Recognized Contributor
Jan 26, 2011
8,452
7,698
23
Salford, Greater Manchester, UK
quinny898.co.uk
I've previously hinted that I was working on getting custom pages working for the launcher on the Pace - well here it is

This allows for custom home screen pages with your own content, there's very little in terms of limits. Code is standard Android Java, you just need to include a library (see GitHub) and follow the example code (the class MUST extend AbstractPlugin, again see the GitHub)

When compiled, the example code shows this on the homescreen page:
WRh713tl.png


Example code and guide for use on GitHub
 

GreatApo

Senior Member
Feb 15, 2011
1,086
658
You are the man! I see you are on flames, I have some suggestions for improvements! :p

...Calender is coming!

Edit:
I tryied to make a new exactly identical project with yours, it installed with no errors, but i couldn't see it anywhere... :p Is there anything else we should notice when making a new project? Except form API version to android 5.0 etc... We make a project for phone not androidware right? (i later added the "android.support.wear" in manifest but without luck).
On the other hand, changing your project worked (i really can't find the problem with mine). However, i tried to load a JS calendar through webview without luck. I see a blank page and if change to app mode, the app crashes :/
Any good way to debug all these from adb? (couldn't find sth in logcat)
 
Last edited:
  • Like
Reactions: jazzymc

Quinny899

Recognized Developer / Recognized Contributor
Jan 26, 2011
8,452
7,698
23
Salford, Greater Manchester, UK
quinny898.co.uk
Whilst working on a little something (see the spoiler below), I found there's something quite important I hadn't mentioned. To update views, you need to run code on the UI thread. There's usually not an easy way to do this - remember, a plugin is not an Activity so we can't do the normal things.

However, Huami thought of this, so you can run:
Code:
getHost().runTaskOnUI(this, new Runnable() {
    @Override
    public void run() {
        ...
    }
});

Coming soon (WIP UI and not complete):
YGlM3fFl.png


I want to get a circular progress bar for the song's duration working as well as iron out some bugs before release. Sadly album art background isn't possible (but would look amazing, especially with palette colour icons!) as the art is not sent to the watch - this page is hooking the built in music control from the phone, no bluetooth trickery at all!
 
  • Like
Reactions: jesuslg123

Quinny899

Recognized Developer / Recognized Contributor
Jan 26, 2011
8,452
7,698
23
Salford, Greater Manchester, UK
quinny898.co.uk
You are the man! I see you are on flames, I have some suggestions for improvements! :p

...Calender is coming!

Edit:
I tryied to make a new exactly identical project with yours, it installed with no errors, but i couldn't see it anywhere... :p Is there anything else we should notice when making a new project? Except form API version to android 5.0 etc... We make a project for phone not androidware right? (i later added the "android.support.wear" in manifest but without luck).
On the other hand, changing your project worked (i really can't find the problem with mine). However, i tried to load a JS calendar through webview without luck. I see a blank page and if change to app mode, the app crashes :/
Any good way to debug all these from adb? (couldn't find sth in logcat)

Sometimes the page loading can be a bit strange. Make sure you're doing nothing demanding in getView - I've found that even adding a listener in getView can cause it to come up blank this evening (use onActive instead)

In terms of logcat, use a normal logcat with no filter, as the logging is split between the launcher itself logging when a page is loaded/unloaded and the app logging when you tell it to. If you want to just show the logs from the app or launcher, I recommend using pidcat

It's also entirely possible the watch struggles with webviews, or may do within the launcher. I've not tested it, but I know they're pretty demanding usually - better to do it in Java because the watch is not that powerful
 

GreatApo

Senior Member
Feb 15, 2011
1,086
658
Sometimes the page loading can be a bit strange. Make sure you're doing nothing demanding in getView - I've found that even adding a listener in getView can cause it to come up blank this evening (use onActive instead)

In terms of logcat, use a normal logcat with no filter, as the logging is split between the launcher itself logging when a page is loaded/unloaded and the app logging when you tell it to. If you want to just show the logs from the app or launcher, I recommend using pidcat

It's also entirely possible the watch struggles with webviews, or may do within the launcher. I've not tested it, but I know they're pretty demanding usually - better to do it in Java because the watch is not that powerful
I am just editing your project :highfive: again, awesome work!
WebView was a dead end for me, i am a javascript quy thats why i was trying it...

Anyway, i edited a simple calendarView (damn it needs a lot of tests), and boom! We have a calendar!
attachment.php

I am adding new icons and i am uploading it as version 1.0.0. Colors are NOT so visible in watch's sreen. I will try to change them (no luck untill now, any idea?) or i will try to use this lib.
 

Attachments

  • com.dinodevs.pacecalendarwidget.png
    com.dinodevs.pacecalendarwidget.png
    163.3 KB · Views: 7,651
Last edited:
Feb 10, 2018
7
0
I am just editing your project :highfive: again, awesome work!
WebView was a dead end for me, i am a javascript quy thats why i was trying it...

Anyway, i edited a simple calendarView (damn it needs a lot of tests), and boom! We have a calendar!
attachment.php

I am adding new icons and i am uploading it as version 1.0.0. Colors are NOT so visible in watch's sreen. I will try to change them (no luck untill now, any idea?) or i will try to use this lib.

Hi all, I imported the Example in Android Studio (Hello world).
It compile with success, but when playing, it tells that no Activity is present.
How to run the example?
Thank you :)
 

GreatApo

Senior Member
Feb 15, 2011
1,086
658
Hi all, I imported the Example in Android Studio (Hello world).
It compile with success, but when playing, it tells that no Activity is present.
How to run the example?
Thank you :)
You can't run it for bebug in PC since this is not a new activity, you just extend the activity of your watch's launcher. So, you install it, reboot your launcher and see the results :p

I suppose you will have to make a new normal apk first to test your code in your PC.
 
Feb 10, 2018
7
0
I've a Pace. I'm trying to compile on it.
Now, I do: Run -> Run... -> Edit Configuration... -> Launch Nothing.
This creates an apk and installs it on the watch.
I rebooted the Pace, but I can't see any new plugin.
Soooob

What am I wrong?

---------- Post added at 06:20 PM ---------- Previous post was at 06:18 PM ----------

However, I've deployed an app of Activities, that I'd like to transform to plugin (as the beautiful calendar!).
May... I have the project, so to copy the steps from it?
Thank you very much
 

GreatApo

Senior Member
Feb 15, 2011
1,086
658
I've a Pace. I'm trying to compile on it.
Now, I do: Run -> Run... -> Edit Configuration... -> Launch Nothing.
This creates an apk and installs it on the watch.
I rebooted the Pace, but I can't see any new plugin.
It extends your watch's launcher activity so you can't run it in Studio. Build apk, install it with adb in your watch and run the given command to reboot your launcher. It should appear at the end of you widgets, else it doent run (remember to uninstall it before reinstalling).

However, I've deployed an app of Activities, that I'd like to transform to plugin (as the beautiful calendar!).
May... I have the project, so to copy the steps from it?
Thank you very much
I can upload them tomorrow at github as a fork of @Quinny899 's project. I haven't provided the sources yet since the changes are small.
 
Last edited:

bmMachine

Senior Member
May 25, 2016
53
5
So, you guys making a custom watch home screen, a cool looking calendar app and new themes (judging from the color of remote music player )for the watch?
 
Feb 10, 2018
7
0
It extends your watch's launcher activity so you can't run it in Studio. Build apk, install it with adb in your watch and run the given command to reboot your launcher. It should appear at the end of you widgets, else it doent run (remember to uninstall it before reinstalling).

I can upload them tomorrow at github as a fork of @Quinny899 's project. I haven't provided the sources yet since the changes are small.

Great! I really appreciate :)
 

Michalec

Senior Member
Oct 11, 2012
214
29
Hello everyone!
I'm new to developing android apps, I've never needed to create my own app. Now I got an idea - I have my own smarthome system and decided to get deeper and create widget with buttons to turn on/off light in my house.
First of all - is this possible? I want to send a UDP packet for static IP and port in my local network.
I'm guessing that this and this should be used?
Thanks in advance for any info :)
 

Quinny899

Recognized Developer / Recognized Contributor
Jan 26, 2011
8,452
7,698
23
Salford, Greater Manchester, UK
quinny898.co.uk
Hello everyone!
I'm new to developing android apps, I've never needed to create my own app. Now I got an idea - I have my own smarthome system and decided to get deeper and create widget with buttons to turn on/off light in my house.
First of all - is this possible? I want to send a UDP packet for static IP and port in my local network.
I'm guessing that this and this should be used?
Thanks in advance for any info :)

The generic internet companion only sends requests, not raw packets. You'd need to either use the WiFi on the watch or create your own companion app for your phone too
 
  • Like
Reactions: Michalec

Michalec

Senior Member
Oct 11, 2012
214
29
The generic internet companion only sends requests, not raw packets. You'd need to either use the WiFi on the watch or create your own companion app for your phone too

Okay, so this could be achieved by using WiFI - I do not need internet connection - only access to my local network.
Any "tutorial" how to use WiFI connection on Amazfit?
 

Top Liked Posts

  • There are no posts matching your filters.
  • 12
    I've previously hinted that I was working on getting custom pages working for the launcher on the Pace - well here it is

    This allows for custom home screen pages with your own content, there's very little in terms of limits. Code is standard Android Java, you just need to include a library (see GitHub) and follow the example code (the class MUST extend AbstractPlugin, again see the GitHub)

    When compiled, the example code shows this on the homescreen page:
    WRh713tl.png


    Example code and guide for use on GitHub
    1
    You are the man! I see you are on flames, I have some suggestions for improvements! :p

    ...Calender is coming!

    Edit:
    I tryied to make a new exactly identical project with yours, it installed with no errors, but i couldn't see it anywhere... :p Is there anything else we should notice when making a new project? Except form API version to android 5.0 etc... We make a project for phone not androidware right? (i later added the "android.support.wear" in manifest but without luck).
    On the other hand, changing your project worked (i really can't find the problem with mine). However, i tried to load a JS calendar through webview without luck. I see a blank page and if change to app mode, the app crashes :/
    Any good way to debug all these from adb? (couldn't find sth in logcat)
    1
    Whilst working on a little something (see the spoiler below), I found there's something quite important I hadn't mentioned. To update views, you need to run code on the UI thread. There's usually not an easy way to do this - remember, a plugin is not an Activity so we can't do the normal things.

    However, Huami thought of this, so you can run:
    Code:
    getHost().runTaskOnUI(this, new Runnable() {
        @Override
        public void run() {
            ...
        }
    });

    Coming soon (WIP UI and not complete):
    YGlM3fFl.png


    I want to get a circular progress bar for the song's duration working as well as iron out some bugs before release. Sadly album art background isn't possible (but would look amazing, especially with palette colour icons!) as the art is not sent to the watch - this page is hooking the built in music control from the phone, no bluetooth trickery at all!
    1
    Hello everyone!
    I'm new to developing android apps, I've never needed to create my own app. Now I got an idea - I have my own smarthome system and decided to get deeper and create widget with buttons to turn on/off light in my house.
    First of all - is this possible? I want to send a UDP packet for static IP and port in my local network.
    I'm guessing that this and this should be used?
    Thanks in advance for any info :)

    The generic internet companion only sends requests, not raw packets. You'd need to either use the WiFi on the watch or create your own companion app for your phone too
Our Apps
Get our official app!
The best way to access XDA on your phone
Nav Gestures
Add swipe gestures to any Android
One Handed Mode
Eases uses one hand with your phone