Friday, January 31, 2014

Customise Voice command for apps in Google Glass?



To enable customize voice command for apps in google glass, follow following steps -
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" />

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

    voice_trigger_start.xml.


3. inside voice_trigger_start.xml file add following line as resources -

<?xml version="1.0" encoding="utf-8"?>
     <trigger keyword="@string/its_me_rakesh" />

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

<resources>    
    <string name="app_name">custome_voice</string>
    <string name="its_me_rakesh">Hello Rakesh</string>    

</resources>


5. Declare an android:icon attribute for your activity or service. This allows Glass to display an icon for your Glassware in the ok, glass touch menu


<activity |service
 
android:icon="@drawable/my_icon" ...>
  ...
</activity | service>



6. If your voice trigger used a voice prompt and starts an activity, obtain any transcribed text with the following code (such as in onResume()):

ArrayList<String> voiceResults = getIntent().getExtras()
       
.getStringArrayList(RecognizerIntent.EXTRA_RESULTS);



7. If the voice trigger starts a service, the intent extra is available in the onStartCommand() callback:

@Override
public int onStartCommand(Intent intent, int flags, int startId) {
   
ArrayList<String> voiceResults = intent.getExtras()
           
.getStringArrayList(RecognizerIntent.EXTRA_RESULTS);
   
// ...
}



8. Starting the speech recognition activity -

The speech recognition activity waits for users to speak and returns the trascribed text after they are done. To start the activity:
  1. Call startActivityForResult() with the ACTION_RECOGNIZE_SPEECH intent. The following intent extras are supported when starting the activity:
    • EXTRA_PROMPT
    • EXTRA_RESULTS_PENDINGINTENT
    • EXTRA_RESULTS_PENDINGINTENT_BUNDLE
  2. Override the onActivityResult() callback to receive the transcribed text from the EXTRA_RESULTS intent extra. This callback is called when users finish speaking.

private static final int SPEECH_REQUEST = 0;
private void displaySpeechRecognizer() {
   
Intent intent = new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH);
    startActivityForResult
(intent, SPEECH_REQUEST);
}
@Override
protected void onActivityResult(int requestCode, int resultCode,
       
Intent data) {
   
if (requestCode == SPEECH_REQUEST && resultCode == RESULT_OK) {
       
List<String> results = data.getStringArrayListExtra(
               
RecognizerIntent.EXTRA_RESULTS);
       
String spokenText = results.get(0);
       
// Do something with spokenText.
   
}
   
super.onActivityResult(requestCode, resultCode, data);
}

 
 

Existing voice commands

When you are developing, you can use any voice trigger that you like. When you want to launch Glassware and have it appear in MyGlass, you must use one of these existing commands or submit a new command for approval
  1. listen to
  2. take a note
  3. post an update
  4. show a compass
  5. start a run
  6. start a bike ride
  7. find a recipe
  8. record a recipe
  9. check me in
  10. start a stopwatch
  11. start a timer
  12. start a round of golf
  13. translate this
  14. learn a song
  15. tune an instrument
  16. play a game
  17. start a workout
 
 
source - developer.google.com/glass


How to start Hangouts from Glassware

I want to start Hangouts from my Glassware so that team can see what is out put is coming.

I did lots of RnD, then I come up with below solution


steps -

1. install myglass  into mobile
2. install your apps in google glass
3. paired with glass with your mobile thr Bluetooth
4. start myglass apps and sync with glass

done

now start you application over the google glass, it will show at mobile in same way and behavior.

let me know if it work




Thursday, January 30, 2014

How to use ok command in google glass application

As time frame of google glass (start on google glass) we are getting "ok glass", if we wish to apply same command over our own application,

Then, you have to update couple of thing in manifest file like -


<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/my_voice_trigger" />
 <uses-permission android:name="android.permission.RECORD_AUDIO"/>
<trigger keyword="@string/glass_voice_trigger">
    <input prompt="@string/glass_voice_prompt" />
</trigger>



Google Glass comes with a handful of Voice Commands right out of the box. With Glass you can do a lot of things like a Google search, take a picture, record a video, send messages, make phone calls, and even start a Google+ Hangout. To get started, all you have to do is say “ok glass” followed by the appropriate voice command.
To get started, make sure your Glass display is active. If the Glass display is not ready to go, you can wake Glass up by touching the touchpad or using Head Wake by lifting your head. After Glass is ready, saying “ok glass” will display all voice commands on your display. To scroll through the list, you can tilt your head or swipe the touchpad back and forth. If this isn’t ideal, without speaking you can open the list of voice command by double tapping the touchpad while on the Home screen.

Google Glass Voice Commands

ok glass, google
To search using the best search engine in the world, simply say “ok glass, google ‘William Shatner Bacon number’”, for example. To search Google even quicker, just long press the touchpad and say your search query, even without the display being active.
ok glass, take a picture
Besides using the camera button to take a picture, you can do it completely hands free by saying “ok glass, take a picture”. After the picture is taken, you’ll see a brief preview before being saved to your timeline. Don’t forget to ask someone for consent before taking their picture.
ok glass, record a video
Want to record hands free video? No problem, just say “okay glass, record a video” and you’ll see a live preview of your recording with a counter. By default, videos only record for 10 seconds. To record a video longer than 10 seconds, while recording, tap your touchpad and select Extend video. To stop the extended recording, tap the touchpad again and swipe to select Stop recording. You can also use the camera button to record a video by holding it down for one second. Don’t forget to ask someone for consent before taking their picture.
ok glass, get directions to
Need directions? You’ll first need to enable this feature through the MyGlass app for Android.  Next, just say “ok glass, get  directions to ‘the nearest Chinese restaurant’” or wherever you want to go such as “1600 Amphitheatre Parkway, Mountain View, CA”. After your directions are found you can swipe through the listings and then tap upon the desired result. To stop navigating or switch to walking or biking directions, tap the touchpad.
ok glass, send a message to
To send voice to text translated messages with Glass, simply say “ok glass, send a message to Derek Ross” or whomever your contact is followed by your message. For example: “ok glass, send a message Derek Ross you’re awesome”. Messages are sent by email unless you have the MyGlass application installed. If the app is installed and the contact has a phone number, an SMS message will be sent. You can add contacts to Glass through the MyGlass website or the MyGlass app.
ok glass, make a call to
To call someone through Glass, you’ll have to pair your device to your phone via Bluetooth. Once paired, just say “ok glass, make a call to Kate Upton” and if you’re lucky enough to have her number, Glass will make the call.
ok glass, hang out with
Thanks to Glass, others can see what you’re seeing anywhere in the world with a Google+ Hangout. To start one, simply say “ok glass, hang out with Sergey Brin” or “ok glass, hang out with Foodies” to Hangout with your Foodies Circle. Your Hangout is then posted on your Google+ stream for the appropriate person or Circle to see. Don’t forget to add your Google+ contacts via the MyGlass site or app before starting a Hangout.
For more information on the above Google Glass Voice Commands, head on over to the official Glass Support site.
Note - Information is collected from different different site and blog.
Welcome to give your feedback and question to write on.

Thursday, January 16, 2014

Resell of google glass

Even we can purchase from 3rd party (as a gift only), it can be possible, but we have to inform google about resell and new guys must open a wallet account at google..

According to the Google Glass terms of service, buyers "may not resell, loan, transfer, or give your Device to any other person."

If you do that without permission, "Google reserves the right to deactivate the Device, and neither you nor the unauthorized person using the Device will be entitled to any refund, product support, or product warranty."

However, the terms also say that you can "give the Device as a gift, unless otherwise set forth in the Device Specific Addendum." If you're lucky enough to land some Google Glass as a gift, you must open and maintain a Google Wallet account to get support.

you may only purchase one Device, and you may not resell, rent, or lease your Device to any other person. If you resell, rent, or lease your Device to any other person without Google’s authorization, Google reserves the right to deactivate the Device, and neither you nor the unauthorized person using the Device will be entitled to any refund, product support, or product warranty. Resource - Google.com/glass

Terms & Condition - to buy an Google Glass:

Here's what's required to buy Glass:
1.       An invitation to Glass, including a unique Glass code (I given a request)
2.       Google Wallet account (Google's payment system) 
3.       A United States address (sorry, no P.O. Boxes)
  1. One Account One Glass - Purchases in bulk are not supported. Purchasing is limited to one per Google Account.
  2. Shipping - Glass ships only to the United States at this time.
  3. International Purchase -  International purchases and shipping is not available.
  4. Sales tax is determined by where you're picking up or delivering Glass. 
  5. No tax exemptions are available for institutions or businesses as we're selling to individuals only at this time.



google glass augmented reality computer

Wednesday, January 15, 2014

How to setup Google Glass in Eclipse

If you're comfortable with Android, here's all you need to know:
---------------------------------------------------------------

1.Get the Android 4.0.3 (API 15) SDK and Glass Development Kit Sneak Peek add-on from the Android SDK Manager.
2.On Glass, turn on USB debugging (Settings > Device Info > Turn on debug).
3.Import some GDK samples with the File > New Project > Android Sample Project menu.
4.When you're ready to create a project for your own Glassware, use these settings:
  ◦Minimum and Target SDK Versions: 15 (There is only one Glass version, so minimum and target SDK are the same.)
  ◦Compile with: Glass Development Kit Sneak Peek
  ◦Theme: None (This allows the Glass theme to be applied.)
5.Head on over to the developer guides for more learning.

What is a Google Glass

Google Glass is a wearable computer with an optical head-mounted display that is being developed by Google in the Project Glass research and development project, with a mission of producing a mass-market ubiquitous computer.

Google Glass displays information in a smartphone-like hands-free format, that can communicate with the Internet via natural language voice commands (from wiki)

Google Glass Explorer Edition
------------------------------------
Also known as                - Project Glass
Developer                       - Google
Manufacturer                   - Foxconn
Type                               - Augmented reality (AR), Optical head-mounted display (OHMD), Wearable
                                          technology, Wearable computer
Release date                    - Developers (US): February 2013 (February 2013)
                                       - Consumers: 2014 (2014)
Introductory price            - Explorer version: $1500 USD
                                        - Consumer edition: "Under $1,500 USD"
Operating system              - Android[4] (4.0.4)
Power                               - Lithium Polymer battery (2.1 Wh)
CPU                                 - OMAP 4430 SoC, dual-core
Memory                            - 1GB RAM (682MB available to developers)
Storage                             - 16 GB Flash total (12 GB of usable memory)
Display                              - Prism projector, 640×360 pixels (equivalent of a 25 in/64 cm screen from 8
                                            ft/2.4 m away)
Sound                                - Bone conduction transducer
Input                                  - Voice command through microphone,accelerometer, gyroscope,
                                            magnetometer,ambient light sensor, proximity sensor
Controller input                  - Touchpad, MyGlass phone app
Camera                             - Photos - 5 MP,
                                            videos - 720p
Connectivity                      - Wi-Fi 802.11b/g, Bluetooth, micro USB
Weight                              - 50g
Backward compatibility     - Any Bluetooth-capable phone; MyGlass companion app requires Android
                                           4.0.3 (Ice Cream Sandwich) or higher or any iOS 7.0 or higher

Details - Website google.com/glass

-------------------------------------------------------------------------------------------