Google Glass gdk-helloword

Source: Internet
Author: User

I found that there are too few materials on glass development in China ~~ Most of them are directly translated by Google, and they are all confused ..

First of all, we need to install the glass SDK. We will not talk about this. Now we will talk about how to set the topic and set the editing interface.

Create a mytheme. xml topic file under Res/values/with the following content:

1 <?xml version="1.0" encoding="utf-8"?>2 <resources>3     <style name="CustomTheme" parent="@android:style/Theme.DeviceDefault">4     </style>5 </resources>

Then, change the XML file in layout:

<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"    xmlns:tools="http://schemas.android.com/tools"    android:layout_width="match_parent"    android:layout_height="match_parent"    tools:context="com.google.mytesttheme.MainActivity" >    <TextView        android:layout_width="match_parent"        android:layout_height="match_parent"        android:gravity="center"        android:keepScreenOn="true"        android:text="@string/hello_world"        android:textColor="#fff"        android:textSize="50sp" />        </FrameLayout>

Note: The above code is for reference only. modify it as appropriate :)

Then, delete Android: theme = "@ style/apptheme" in androidmanifest. xml.

Then, write the code in mainactivity. Java as follows:

1 @ override 2 protected void oncreate (bundle savedinstancestate) {3 super. oncreate (savedinstancestate); 4 card = new card (this); 5 card. settext ("this is my first Google Glass gdk application! "); 6 card. setfootnote ("maid"); 7 // card. addimage (R. drawable. IMG); 8 view = card. getview (); 9 setcontentview (View); 10 // setcontentview (R. layout. activity_main); 11}

What you know ~~

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.