Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Finish Mobile <-> WearOS Communication #8

Closed
19 tasks done
thehale opened this issue Feb 10, 2024 · 3 comments
Closed
19 tasks done

Finish Mobile <-> WearOS Communication #8

thehale opened this issue Feb 10, 2024 · 3 comments
Milestone

Comments

@thehale
Copy link
Owner

thehale commented Feb 10, 2024

This is a top-level ticket tracking progress towards full implementation of the SimpleTimeTrackerAPI on both the WearOS and Mobile apps.

Background

Communication between the WearOS app and the Mobile app occurs via an RPC Client/Server implemented using Google's MessageClient and its related APIs.

The plumbing of the communication is already complete: the wear app has an RPC client that sends messages to the phones's RPC server (implemented as a Service so it can respond even when the app is in the background or the phone is sleeping).

sequenceDiagram
    actor User
    
    box green WearOS
    participant UI (Wear)
    participant WearRPCClient
    participant Messenger
    end

    box blue Phone
    participant WearService
    participant WearRPCServer
    participant DomainAPI
    end

    User->>UI (Wear): Interact with Wear app
    UI (Wear)->>WearRPCClient: Request needed data
    WearRPCClient->>WearRPCClient: Serialize message to BytesArray
    WearRPCClient->>Messenger: Request message delivery
    Messenger->>Messenger: Find nearest node
    Messenger->>WearService: Send message to phone
    WearService->>WearService: Wake up from sleep/background
    WearService->>WearRPCServer: Delegate message to RPC Server
    WearRPCServer->>WearRPCServer: Parse the message
    WearRPCServer->>DomainAPI: Request needed data
    DomainAPI->>DomainAPI: Query/update the Database
    DomainAPI->>WearRPCServer: Return data from database
    WearRPCServer->>WearService: Serialize response to BytesArray
    WearService->>Messenger: Return response
    Messenger->>Messenger: Run validation checks/error handling
    Messenger->>WearRPCClient: Forward response
    WearRPCClient->>WearRPCClient: Parse response
    WearRPCClient->>UI (Wear): Return requested data
    UI (Wear)->>User: Render UI update

Both the WearRPCClient and the DomainAPI implement the SimpleTimeTrackerAPI interface which defines all the methods believed to be necessary for the WearOS MVP.

Remaining Work

The following list of tickets track each method in WearRPCClient and DomainAPI not yet implemented. Once all the following are complete, this ticket can be closed as complete.

WearOS app

  • Implement WearRPCClient.ping
  • Implement WearRPCClient.queryActivities
  • Implement WearRPCClient.queryCurrentActivities
  • Implement WearRPCClient.setCurrentActivities
  • Implement WearRPCClient.queryTagsForActivity
  • Implement WearRPCClient.querySettings

Mobile app

  • Implement WearRPCServer.onRequest
  • Implement WearRPCServer.onPing
  • Implement WearRPCServer.onQueryActivities
  • Implement WearRPCServer.onQueryCurrentActivities
  • Implement WearRPCServer.onSetCurrentActivities
  • Implement WearRPCServer.onQueryTagsForActivity
  • Implement WearRPCServer.onQuerySettings
  • Implement DomainAPI.ping
  • Implement DomainAPI.queryActivities
  • Implement DomainAPI.queryCurrentActivities
  • Implement DomainAPI.setCurrentActivities
  • Implement DomainAPI.queryTagsForActivity
  • Implement DomainAPI.querySettings
@thehale
Copy link
Owner Author

thehale commented Feb 13, 2024

Another large tranche of methods were implemented in d46bccf

@thehale thehale added this to the MVP milestone Feb 13, 2024
@thehale
Copy link
Owner Author

thehale commented Feb 15, 2024

DomainAPI.queryTagsForActivity was completed in ef3384f

@thehale
Copy link
Owner Author

thehale commented Feb 15, 2024

DomainAPI.queryCurrentActivities was fully completed in c328fc1

@thehale thehale unpinned this issue Feb 19, 2024
thehale added a commit that referenced this issue Feb 27, 2024
Finally, a full cycle, MVP of the wear app!

This commit adds the ability to start activities
on the phone from the wear app. Choose an
activity and the associated tag, and the phone app
will update accordingly.

Of course, the app still has plenty of bugs and
rough edges, but this is a huge milestone!

closes #5
closes #8
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

No branches or pull requests

1 participant