zoukankan      html  css  js  c++  java
  • Google glass GDK

    发现国内关于glass开发的资料太少了~~大多都是直接谷歌翻译原文过来的,看着都稀里糊涂的。。

    首先呢,我们需要安装了glass的SDK,这些就不讲了,现在讲如何设置主题以及设置编辑界面

    在res/values/下创建一个myTheme.xml主题文件,内容如下:

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

    然后把layout下的xml文件改为:

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

    注意,以上代码仅供参考,适当的修改即可 :)

    然后在AndroidManifest.xml中把 android:theme="@style/AppTheme" 删了

    然后设置基本就这样,在MainActivity.java中写入代码:

     1     @Override
     2     protected void onCreate(Bundle savedInstanceState) {
     3         super.onCreate(savedInstanceState);
     4         Card card = new Card(this);
     5         card.setText("这是我的第一个Google glass GDK应用哦!");
     6         card.setFootnote("Ch3rry");
     7         // card.addImage(R.drawable.img);
     8         View view = card.getView();
     9         setContentView(view);
    10         // setContentView(R.layout.activity_main);
    11     }

    你都懂的~~

  • 相关阅读:
    poj 2676 Suduku (dfs)
    poj 1562 Oil Deposits (dfs)
    poj 2907 Collecting Beepers (dfs)
    poj 1655 Balancing Act (树形dfs)
    poj 3411 Paid Roads (dfs)
    hdu 2896 病毒侵袭 (AC)
    hdu 3065 病毒侵袭持续中 (AC)
    poj 2251 Dungeon Master (bfs)
    java中debug使用
    Swing入门级小项目总结
  • 原文地址:https://www.cnblogs.com/ch3rry/p/3850843.html
Copyright © 2011-2022 走看看