Tag Archives: google

What comes with the new Google GLASS Development Kit?

The GDK is an Android SDK add-on that contains APIs for Glass-specific features.
sdk-gdk

Unlike the Mirror API, Glassware built with the GDK runs on Glass itself, allowing access to low-level hardware features.

At the time of writing this article Sample GDK has been released out introducing ways to develop native android apps for Google Glass.

gdk-glassware-android

So what does the new GDK brings

1. A new platform for you to develop your GLASS apps so it will have special libraries needed to for the Google GLASS. Not all are available yet, you have to wait for the final version to come.

2.Touch Gestures – Accessing raw data from the Glass touchpad is possible with the Android SDK. However, the GDK provides a gesture detector designed for the Glass touchpad that automatically detects common gestures on Glass, including tapping, swiping, and scrolling. Click Here for detailed info on developing

3.Voice Input – Voice is an integral part in a hands-free experience for users. Glass lets you declare voice triggers to launch your Glassware from the ok glass voice menu. Click Here for detailed info on developing

4.Location and Sensors – You access location and sensor data using the standard Android platform APIs. You have to access the paired device for location and there is another way of gettin location without the help of paired device. It is taken based on the Wifi hotspot, but it wont be accurate as much as the location taken fron the paired device’s gps. Click Here for detailed info on developing

5.Camera – You can use the Glass camera to capture images and video and to also display the camera’s preview stream for a variety of different use cases. Click Here for detailed info on developing

Reference : Site Name – Glass Development KIT, Url – https://developers.google.com/glass/develop/gdk/index, Date 5th December 2013, Time – 12.13pm (GMT +5.30)

Advertisements

Google Glass – Adding your Own Voice Commands to Your Apps

Hey guys with the introduction of the Glass development Sneak Peek, I found the way to add your own voice command to trigger your app. This is for native Android Apps.

What you have to do is,

Step 1
inside the manifest file add these tags under the service which you wanted to trigger on your voice command.

<intent-filter>
<action android:name=”com.google.android.glass.action.VOICE_TRIGGER” />
</intent-filter>
<meta-data
android:name=”com.google.android.glass.VoiceTrigger”
android:resource=”@xml/voice_trigger_start” />

Step 2And you have to create a folder called xml inside res and add a xml file named as “voice_trigger_start.xml”

Step 3
Inside that add these lines

<?xml version=”1.0″ encoding=”utf-8″?>

<trigger keyword=”@string/its_me_amalan” />

Step 4
Open the values folder inside res folder and edit strings.xml, so it will look like this

<resources>
<string name=”app_name”>Amalan</string>
<string name=”its_me_amalan”>Hello Amalan</string>
<string name=”stop”>Stop</string>
</resources>

Now install the app into the google glass and say
OK GLASS Hello Amalan
And the app opens

I have used my name 😉 but you can try lots of other words.

Please install the latest  Glass Development KIT and tryout the samples, you can get more out of it 🙂

Get the Source here
gitHub-download-button

 

Google Glass in Colombo Agile Meetup…!

1st of October 2013 at Voice Lounge, Burgher Recreation Club, Colombo Agile Meetup hosted one of their most wanted meetups featuring the famous Google Glass. So the topic is “A real life case study of a Google glass project.”

20130912_143933

Shamira Dias (Delivery Manager, Exilesoft), started the talk, with the Subject “Unfamiliar territory and uncertain outcomes: The Google Glass Project”. So he elaborated the types of projects that Exilesoft do, and how the developers here at office and onsite, deal with it. Sometimes they are not familiar with the business domain, but holding back is not the prudent thing to do. Therefore, to add to it, when a project appears with an unfamiliar object he explained using the Google Glass project which they are currently working on in Exilesoft, how agile practice helped them, and how they co op-ed and won, in the end.

1381930_10151585171006710_1273619941_n

Next the talk was passed onto Sanath Nandasiri (Software Engineer, Exilesoft) one of the two developers, directly connected with the ongoing Google Glass project (the other one is Me ). He explained what Google Glass is, what it has, what it can do and available features on it.  So the session went with some live Google Glass Demo, which really entertained the audience. One of the important features I thought was, it runs Android 4.0.4 and it got a wonderful natural voice recognition which has a high accuracy rate.

556621_10151585171726710_2012012341_n

Further on Sanath moved into Google Glass development. There are 2 ways that we can approach the GLASS development. They are the native way (Android) and the Glassware development (Server Side using Mirror API). Then he explained how the glassware works, what the role of the Mirror API is and the technologies used to develop a glassware. Native development is similar to the traditional android development but with some restriction of functionality and libraries. One of the reason for the restriction is caused by the lack of sensors in Google GLASS unlike normal Android phone. Those functions can be achieved by pairing to your Android phone through Bluetooth. Also explained how the glassware authentication take place under the hood.

Then another round of demo session took place explaining the Google GLASS Time line. And a cool thing happened for developers, there has been a code review on Glassware and the code has been open sourced. The source can be downloaded here. Also as a bonus, Sanath explained and showed how you can bring in Google Glass in your Android phone that is running Android 4.0.4 or later, this will be a great emulator to test your Glassware apps (It cannot be used to test native apps though).

Finally Dulan Bandara (Software Engineer, Exilesoft), explained about unit testing and its importance in the Glass Project. Then he compared unit test on Android and unit testing on Google Glass. There was a hands on coding demo for the unit testing. It’s important to mention that a bunch of visitors got a chance to try out the Google Glass. They were awed at the experience they got.

63626_10151585172331710_1821980851_n

The talk came to an end with the Introduction of a new meet up group “Colombo Mobile Meetup”, and an Announcement of the upcoming DevDay 2013.

For the complete collection of research and development article on Google Glass explore my Blog.

Meetup Organized by Exilesoft (Pvt) Ltd.

Stream You Tube Video, in Google Glass Time Line Card, using Mirror API(C#.net)

Ok guys today we will see how we can stream a Youtube video inside a google glass timeline card.  First you need to add reference to the “YoutubeExtractor” namespace. You can get it from the nuget if you dont have it.

using YoutubeExtractor;

Now add the youtube video url to atring(The url you got when you clicked the share button not the page url).
Resolve the url and get the links for the available videos.
Select the video you wanted to stream and get the stream url.

string link = "http://youtu.be/9uYKISlL7Vg";
IEnumerable<VideoInfo> videoInfos = DownloadUrlResolver.GetDownloadUrls(link);
VideoInfo video = videoInfos.First(info => info.VideoType == VideoType.Mp4 && info.Resolution == 360);
String vLink = video.DownloadUrl;

Now create the timeline card and add the menu item

TimelineItem yotubeVideo = new TimelineItem()
{
Text = "Youtube Video",
BundleId = "8081",
MenuItems = new List<MenuItem>() { { new MenuItem() { Action = "DELETE" } } },
Notification = new NotificationConfig() { Level = "DEFAULT" }
};

Create a stream using the link we got, create a http request, buffer it and insert the card mentionng the video type.

String videoLink = vLink;

if (!String.IsNullOrEmpty(videoLink))
{
Stream stream = null;
if (videoLink.StartsWith("/"))
{
stream = new StreamReader(controller.Server.MapPath(videoLink)).BaseStream;
}
else
{
HttpWebRequest request = WebRequest.Create(videoLink) as HttpWebRequest;

request.UseDefaultCredentials = false;

HttpWebResponse response = request.GetResponse() as HttpWebResponse;

byte[] b = null;
using (Stream streamFromWeb = response.GetResponseStream())
using (MemoryStream ms = new MemoryStream())
{
int count = 0;
do
{
byte[] buf = new byte[1024];
count = streamFromWeb.Read(buf, 0, 1024);
ms.Write(buf, 0, count);
} while (streamFromWeb.CanRead && count > 0);
b = ms.ToArray();

stream = new MemoryStream(b);
}
}
controller.Service.Timeline.Insert(yotubeVideo, stream, "video/mp4").Upload();

Now the stream will work like a charm

Adding a time line card using Mirror API, that can make call from Google Glass (C#.net)

To call a person you need contact details of a person so we will create a contact first.

Contact Amalan = new Contact();
Amalan.PhoneNumber = "+940711111111";

Now create a Timeline card and add call function on the menu item of the  card. When create the timeline card add the contact we created as the Creator

TimelineItem contactNumber = new TimelineItem()
{

Text = "Call Amalan",
BundleId = "8081",
Creator = Amalan,
MenuItems = new List<MenuItem>() {
new MenuItem() {Action = "VOICE_CALL"},
new MenuItem() {Action = "DELETE"}},
Notification = new NotificationConfig() { Level = "DEFAULT" },

};

Now we will insert the card that we created

controller.Service.Timeline.Insert(contactNumber).Fetch();

That’s it now you can make the call using the timeline card. Don’t forget to pair your phone with the GLASS

Insert Video in, Google Glass Time Line Cards, using Mirror API(C#.net)

private static String InsertVideo(MainController controller)
{

TimelineItem critical = new TimelineItem()
{

//Text = "Third Card",
BundleId = "346",
//IsBundleCover=true,
//Html = "<article class=\"photo\">\n  <img src=\"http://www.youtube.com/watch?v=suz446-BOHg\" width=\"100%\" height=\"100%\">\n  <div class=\"photo-overlay\"/>\n  <section>\n    <p class=\"text-auto-size\">Third Card</p>\n  </section>\n</article>",
//Attachments = new List<Attachment>() {new Attachment(){ContentUrl="http://www.youtube.com/watch?v=suz446-BOHg"}},
//MenuItems = menu,
Notification = new NotificationConfig() { Level = "DEFAULT" },
MenuItems = new List<MenuItem>()
{
new MenuItem() {Action = "NAVIGATE"},
new MenuItem() {Action = "DELETE"},
new MenuItem() {Action = "SHARE"},
}
// Locaton = location.Latitude
//bundleId = 10001;
};

String mediaLink = "your video link as text here";

if (!String.IsNullOrEmpty(mediaLink))
{
Stream stream = null;
if (mediaLink.StartsWith("/"))
{
stream = new StreamReader(controller.Server.MapPath(mediaLink)).BaseStream;
}
else
{
HttpWebRequest request = WebRequest.Create(mediaLink) as HttpWebRequest;
HttpWebResponse response = request.GetResponse() as HttpWebResponse;

byte[] b = null;
using (Stream streamFromWeb = response.GetResponseStream())
using (MemoryStream ms = new MemoryStream())
{
int count = 0;
do
{
byte[] buf = new byte[1024];
count = streamFromWeb.Read(buf, 0, 1024);
ms.Write(buf, 0, count);
} while (streamFromWeb.CanRead && count > 0);
b = ms.ToArray();

stream = new MemoryStream(b);
}
}
controller.Service.Timeline.Insert(critical, stream, "video/mp4").Upload();
}
else
{
controller.Service.Timeline.Insert(critical).Fetch();
//controller.Service.Timeline.Update

}

return "A timeline item has been inserted.";

}

Credit goes to Sanath Nandasiri

Google Glass and It’s Battery Consumption

Ok, developing apps and glassware for Google Glass seems to be not a big deal……!
But there are some hidden issues we have to take care of…!

GoogleGlass_1

1st one is Battery and the 2nd one is Performance…!

Even though the Google said the Battery will last for 1 Day, I could not experience the glass battery as long as that, unless it was left to sleep. When the Battery was full, I started taking a video, I got warning in 20 minutes saying battery is low, that’s it, I have to stop taking video and shutdown the glass. Here is the Video Taken.

So you must have understood, how poor the battery life is in Google Glass. So running a native Android is really a battery draining factor, specially pairing to phone through Bluetooth. And if you are using any sensors in the glass then that will cause heavy battery usage.

Alternatively we can do something like, keeping down the brightness of the display, and put the glass to sleep at most of the time(When app is idle). Avoid doing heavy process in the glass by sending the data to a server and process it and get the result.

I have read some people’s review say, using Glassware can solve the battery problem. Yes, as it is a plain html card which does not java script it won’t drain much battery.

But anyway the cards are shown in web browser objects. Smart phone users know the battery drain very much when they use web browser. So If the glassware results are going to be  shown in a series of web browser object which is called time line won’t it be draining battery very much? This point is just a conceptual thinking of mine.

Even though we have discussed only some facts about battery, there are more hidden battery factors too. But some leaked patent doc shows possible 2 side battery increasing the battery capacity by double.

One of my friends suggested a tip and it is using external battery w/USB
Here is the picture of it. You can try this too if you want more battery power. Further he mentioned that it lasts for the whole day. If you like follow him on twitter for more tips
BVfIq94IEAAZP3B.jpg large

That’s all for today, catch you guys soon with more on Google Glass…!