Bluetooth

Páginas: 5 (1126 palabras) Publicado: 1 de diciembre de 2011
Android & Bluetooth
Juan Antonio Breña Moral

Índice de contenido
Infraestructura.......................................................................................................................................1 Creando el primer proyecto en Android...............................................................................................1Ejemplo1..........................................................................................................................................1 Estructura de ficheros de un proyecto en Android......................................................................1 Codigo fuente..............................................................................................................................2Bluetooth..............................................................................................................................................3 FAQ......................................................................................................................................................3 Debug certificateexpired.................................................................................................................3

Infraestructura
http://www.eclipse.org/downloads/ http://developer.android.com/sdk/index.html http://developer.android.com/sdk/eclipse-adt.html
https://dl-ssl.google.com/android/eclipse/

Creando el primer proyecto en Android
Ejemplo1
En el primer ejemplo, se creara un proyecto desde 0 y se aprendera los siguientes conceptos:

Estructura de ficheros de un proyectoen Android

Codigo fuente
Clase package org.urjc.example1; import android.app.Activity; import android.os.Bundle; public class example1 extends Activity { /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); } } UI


Bluetoothhttp://developer.android.com/guide/topics/wireless/bluetooth.html package jab.android.essentials; import jab.lejos.gps.*; import android.app.Activity; import android.app.Dialog; import android.bluetooth.BluetoothAdapter; import android.bluetooth.BluetoothDevice; import android.bluetooth.BluetoothSocket; import android.content.Context; import android.hardware.Sensor; import android.hardware.SensorEvent; importandroid.hardware.SensorEventListener; import android.hardware.SensorManager; import android.os.Bundle; import android.view.Menu; import android.view.MenuItem; import android.view.View; import android.content.Intent; import android.content.res.Resources; import android.net.Uri; import android.util.Log; import android.view.View.OnClickListener; import android.view.Window; import android.widget.Button; importandroid.widget.EditText; import android.widget.SeekBar; import android.widget.SeekBar.OnSeekBarChangeListener; import android.widget.TextView; import android.widget.Toast; import java.io.DataInputStream; import java.io.IOException; import java.io.PrintWriter; import java.io.DataOutputStream; import java.net.*;

import java.util.UUID; import java.util.List; import java.util.Enumeration; importjava.util.Set; public class RFCommConnection extends Activity { public static final String DEFAULT_NXT_NAME = "GSYC"; public static final int ACTION=10; public static final int DISCONNECT = 99; public static final int MENU_ABOUT = Menu.FIRST; public static final int MENU_QUIT = Menu.FIRST + 1; private SensorManager sensorManager; private boolean runWithEmulator = false; private SeekBar pitchSeekBar;private SeekBar rollSeekBar; private Button connectButton; private Button actionButton; private TextView myNXT; private BluetoothSocket nxtBTsocket = null; private DataOutputStream nxtDos = null; private DataInputStream nxtDis = null; private GPS gps; private long timeDataSent = 0; /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) {...
Leer documento completo

Regístrate para leer el documento completo.

Estos documentos también te pueden resultar útiles

  • Bluetooth
  • Bluetooth
  • Bluetooth
  • Bluetooth
  • bluetooth
  • Bluetooth
  • Bluetooth
  • Bluetooth

Conviértase en miembro formal de Buenas Tareas

INSCRÍBETE - ES GRATIS