Back to project page GlassCounter.
The source code is released under:
Apache License
If you think the Android project GlassCounter listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package com.github.barcodeeye.scan; // ww w . j a v a2 s . c o m import android.app.Activity; import android.content.Context; import android.media.AudioManager; import android.os.Bundle; import android.view.KeyEvent; import android.view.View; import android.view.WindowManager; import com.google.android.glass.app.Card; import com.google.android.glass.media.Sounds; public class FourthActivity extends Activity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON); View myView = createCards(); setContentView(myView); } private View createCards() { //mCards = new ArrayList<Card>(); Card card; card = new Card(this); card.setText("Data successfully submitted!"); card.setFootnote("Finish"); View cardView = card.getView(); return cardView; } /** * Handle the tap from the touchpad. */ @Override public boolean onKeyDown(int keyCode, KeyEvent event) { switch (keyCode) { // Handle tap events. case KeyEvent.KEYCODE_DPAD_CENTER: case KeyEvent.KEYCODE_ENTER: // Status message below the main text in the alternative UX layout AudioManager audio = (AudioManager)getSystemService(Context.AUDIO_SERVICE); audio.playSoundEffect(Sounds.TAP); return true; default: return super.onKeyDown(keyCode, event); } } @Override public void onResume() { super.onResume(); } @Override public void onPause() { super.onPause(); } @Override public void onDestroy() { super.onDestroy(); } }