How to design Layout for both Rectangular and Round Android Watch?

How to design Layout for both Rectangular and Round
Android Watch?

Android watches comes in two shapes, round and rectangular.Therefore
WatchViewStub is available .It is a class that can inflate a specific layout,
depending on the shape of the device’s screen.

Use WatchViewStub to inflate the view as below.

public class MainActivity extends Activity {
private RelativeLayout mRectBackground;
private RelativeLayout mRoundBackground;

public void onCreate(Bundle b) {
WatchViewStub stub = (WatchViewStub) findViewById(;
stub.setOnLayoutInflatedListener(new WatchViewStub.OnLayoutInflatedListener()
public void onLayoutInflated(WatchViewStub stub) {
mRectBackground = (RelativeLayout)
mRoundBackground = (RelativeLayout)

In the layout file of the main activity (main_activity.xml) you may specify the
layout for each watch type as below.It will automatically pick the correct
layout as required by the device.Also design two separate layout files for
each type of shapes.In this case rect_activity_my_wear.xml and

Later if we want to animate the views as per their shapes on touch we can
have the logic as below

public void onLayoutClicked(View view) {
if (mRectBackground != null) {
// Logic for Rectangular shaped watch
if (mRoundBackground != null) {
// Logic for round shaped watch

Posted in Android Apps | Tagged , , | Leave a comment

How to Implement Voice Command in Android Watch

How to Implement Voice Command in Android Watch

Voice commands are very important for smart watches as users do not like to
interact with a small screen watch by tapping.In this short article I will explain
how to implement voice command capability in an Android Watch application.

1) App Provided Voice Action.

For example say “RunActivity” is my starting activity for the watch
application.The objective is to provide a voice command like “Start
RunActivity” ,then add “android:label” as below :
<activity android:name=“.RunActivity” android:label=”RunActivity”>
<action android:name=”android.intent.action.MAIN” />
<category android:name=”android.intent.category.LAUNCHER” />

2) Free form speech input.

In addition to voice command to launch an activity , we can also provide voice
recognizer facility to recognize a voice command and then process it. For
private static final int SPEECH_REQUEST_CODE = 0;
// Create an intent that can start the Speech Recognizer activity
private void displaySpeechRecognizer() {
Intent intent = new
// Start the activity, the intent will be populated with the speech text
startActivityForResult(intent, SPEECH_REQUEST_CODE);
// This callback is invoked when the Speech Recognizer returns.
// This is where you process the intent and extract the speech text from the
protected void onActivityResult(int requestCode, int resultCode,
Intent data) {
if (requestCode == SPEECH_REQUEST && resultCode == RESULT_OK)
List<String> results = data.getStringArrayListExtra(
String spokenText = results.get(0);
// Do something with spokenText
super.onActivityResult(requestCode, resultCode, data);

Here is the link for the example project.Have fun playing with it.

Posted in Android Apps | Tagged , , , , , , | Leave a comment

2D Picker UI Pattern for Android Wear

2D Picker UI Pattern for Android Wear

Android watch is the new thing to explore for Android developers.While it is fun to develop apps with the the same UI principles of Android mobile phones,it is worth looking at googles UI recipes for watches.One of the most interesting UI patterns that I like is 2D Picker pattern.In this article I will explain the need of 2D Picker pattern and present an example project to play with.

2D Picker patterns is very nicely thought recipe for a small screens. Imagine we are developing flight status watch application for our ImagineAir airlines.The objective of the application is to provide informations of all the flights . If we are developing a mobile application the design should start with a selection for cities,then present a scroll view of all the flights departing and arriving the city.If the user selects a flight he or she will be provided the detailed information.But if I have to do the same for a watch it will be a bad user experience . The user will be bombarded with information in a very small screen.

Now lets think about the same information to be presented differently.We present very little information on demand.And that is the objective of 2D Picker pattern.So We allow the user to select whether arrival or departure information is required.Once selected let the user navigate cities by down swipe.User can swipe down to find a new city. While in a city it can be swiped right to fight the details of the flight one after another right swipe .On swiping down the user can see the next city or on swiping to right the user will be presented with the flight details one at a time.

So the user is navigating down or right to find deeper information as he or she needs.It is a nice experience ,less confusing and information is on demand.We need to remmeber that navigation should be vertical and then horizontal just like we write bulleted headings one below another then expand each bullet horizontally.

For example:



Continue reading

Posted in Android Apps | Tagged , , , , , , , | Leave a comment

KidsScience iPhone app a new way to learn science for K-12 kids

In today’s world, kids have access to all the technology gadgets of today such as iPhone, iPad, iPod Touch and other devices. Kids spend a great amount of time playing games, browsing while using these devices. Could we use these devices while providing quality education to kids ?

It’s a challenge for parents to make use of these devices in a productive way for kids. With that in mind, Sprima has developed a number of educational applications such as “KidsScience” for K-12 kids. The app is mainly divided into 2 group of questions. One for elementary kids and one for high school kids. The questions are based on various states’ syllabuses. The app generates questions and let the kid select a correct answer. It provides immediate feedback, if the answer is correct or wrong. If the answer is wrong, it provides the correct answer. The app also keeps the time taken to solve the questions.

It’s a very simple app to keep kids engaged while learning social science, natural science and other artifacts of science.

Feel free to provide feedback of the app to us at appleStore or info @ .

Like us at and send us your request for Free Promo Codes. We will will give away 10 Promo Codes. First Come, first serve.

Posted in iPhone Apps | Leave a comment

How to set up the Self Monitoring for OVO, if it was deleted by mistake ?

OVO provides policies, scripts and tools for self-monitoring purposes. However, if those policies, scripts or tools are deleted, those utilities could be restored quite easily.

All self monitoring configuration data and the HPOM Java GUI integration are stored in the directory /opt/OV/OMU/adminUI/data/init/ovo/selfmon

We can use opccfgupld command  to upload this data. Here is how to restore the scripts, policies etc.
# cd /opt/OV/OMU/adminUI/
# opccfgupld -add $PWD/data/init/ovo/selfmon

Posted in OVO/OM/OMU/OMW | Tagged , , | Leave a comment

How to approve Pending certificate request from OVO Management station ?

First of all log into OVO management station. Check, if there is any certificate request is pending by running the following command.

/opt/OV/bin/ocvm –listpending –l

If you see any pending request, you could approve the certificate request by running the following command in management station.

ovcm –grant <Request ID>

At this time, if you run the earlier command, ( /opt/OV/bin/ocvm –listpending –l  ), you won’t see the pending Request ID for the approved certificate.

Posted in OVO/OM/OMU/OMW | Tagged | 2 Comments

How to check if any certificate request is pending in OVO Management Station ?

Log on into your OVO Management station.

To check if there is any certificate request is pending from any of the agents run the following command.

/opt/OV/bin/ocvm –listpending –l


It would show if any certificate request is pending or nothing is pending.

Posted in OVO/OM/OMU/OMW | Tagged | 2 Comments

How to download Configuration data of OVO/OMU ?

One can download the configuration data by using the following command.


This command will allow to select the parts of the configuration that the user wants to download.

Posted in OVO/OM/OMU/OMW | 2 Comments

How check the certificates available to OVO Client ?

Here are the steps to find the certificates available to a local OVO client .

(1) Log into the local OVO client system

(2) Run the following command.

/opt/OV/bin/ovcert –list

Posted in OVO/OM/OMU/OMW | 1 Comment

How to remove the trusted certificate from OVO client ?

Run the following command on the OVO client to remove the trusted certificate.

/opt/OV/bin/ovcert –remove < Trusted Certificate ID>

Posted in OVO/OM/OMU/OMW | Leave a comment