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 ~~