Coder Social home page Coder Social logo

Aplite or Basalt about pebblejs HOT 2 CLOSED

pebble avatar pebble commented on July 23, 2024
Aplite or Basalt

from pebblejs.

Comments (2)

fletchto99 avatar fletchto99 commented on July 23, 2024

@kropochev PebbleJS is designed to detect the platform running and display the elements based on what's avaliable. However if you wish to display only specific information on a platform then you can use Pebblekit JS directly in your PebbleJS app. Here's a simple example:

var UI = require('ui');

var body;

var basalt = false;

//Determine if getActiveWatchInfo function is defined, if so SDK > 3.0
if(Pebble.getActiveWatchInfo) { //There exists Pebble.getActiveWatchInfo().platform; however it appears to be broken. I'll check into this further
    body = 'PebbleKit JS ready on Basalt!';
    basalt = true;
} else {
    // This is the Aplite platform, getActiveWatchinfo is unavaliable in SDK versions < 3.0
    body = 'PebbleKit JS ready on Aplite!';
}

//A simple card to display the results
new UI.Card({
  title: 'Watch Info',
  subtitle: 'Using Pebble JS',
  body: body
}).show();

from pebblejs.

kropochev avatar kropochev commented on July 23, 2024

Thank you very much!

from pebblejs.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.