Browse files

App apresentada durante a AndroidConf Brasil 2011 sobre a utilização da

Wikitude API para simular Realidade Aumentada (Augmented Reality) em
Android.
  • Loading branch information...
0 parents commit a2a6321765d464602cee61d9458dc61182b8588b @ramonrabello committed Dec 22, 2011
9 Realidoid/.classpath
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="src" path="gen"/>
+ <classpathentry kind="con" path="com.android.ide.eclipse.adt.ANDROID_FRAMEWORK"/>
+ <classpathentry kind="con" path="com.android.ide.eclipse.adt.LIBRARIES"/>
+ <classpathentry kind="lib" path="libs/wikitudearintent.jar"/>
+ <classpathentry kind="output" path="bin/classes"/>
+</classpath>
33 Realidoid/.project
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>Realidoid</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>com.android.ide.eclipse.adt.ResourceManagerBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>com.android.ide.eclipse.adt.PreCompilerBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>com.android.ide.eclipse.adt.ApkBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>com.android.ide.eclipse.adt.AndroidNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
27 Realidoid/AndroidManifest.xml
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="utf-8"?>
+<manifest xmlns:android="http://schemas.android.com/apk/res/android"
+ package="wikitude.teste"
+ android:versionCode="1"
+ android:versionName="1.0" >
+
+ <uses-sdk android:minSdkVersion="7" />
+
+ <application
+ android:icon="@drawable/ic_launcher"
+ android:label="@string/app_name" >
+ <activity
+ android:label="@string/app_name"
+ android:name="br.com.androidnarede.realidoid.RealidoidActivity" >
+ <intent-filter >
+ <action android:name="android.intent.action.MAIN" />
+
+ <category android:name="android.intent.category.LAUNCHER" />
+ </intent-filter>
+ </activity>
+ </application>
+
+ <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
+ <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
+ <uses-permission android:name="android.permission.INTERNET" />
+
+</manifest>
BIN Realidoid/bin/Realidoid.apk
Binary file not shown.
BIN Realidoid/bin/classes.dex
Binary file not shown.
BIN Realidoid/bin/res/drawable-hdpi/ic_launcher.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN Realidoid/bin/res/drawable-ldpi/ic_launcher.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN Realidoid/bin/res/drawable-mdpi/ic_launcher.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN Realidoid/bin/resources.ap_
Binary file not shown.
BIN Realidoid/libs/wikitudearintent.jar
Binary file not shown.
40 Realidoid/proguard.cfg
@@ -0,0 +1,40 @@
+-optimizationpasses 5
+-dontusemixedcaseclassnames
+-dontskipnonpubliclibraryclasses
+-dontpreverify
+-verbose
+-optimizations !code/simplification/arithmetic,!field/*,!class/merging/*
+
+-keep public class * extends android.app.Activity
+-keep public class * extends android.app.Application
+-keep public class * extends android.app.Service
+-keep public class * extends android.content.BroadcastReceiver
+-keep public class * extends android.content.ContentProvider
+-keep public class * extends android.app.backup.BackupAgentHelper
+-keep public class * extends android.preference.Preference
+-keep public class com.android.vending.licensing.ILicensingService
+
+-keepclasseswithmembernames class * {
+ native <methods>;
+}
+
+-keepclasseswithmembers class * {
+ public <init>(android.content.Context, android.util.AttributeSet);
+}
+
+-keepclasseswithmembers class * {
+ public <init>(android.content.Context, android.util.AttributeSet, int);
+}
+
+-keepclassmembers class * extends android.app.Activity {
+ public void *(android.view.View);
+}
+
+-keepclassmembers enum * {
+ public static **[] values();
+ public static ** valueOf(java.lang.String);
+}
+
+-keep class * implements android.os.Parcelable {
+ public static final android.os.Parcelable$Creator *;
+}
11 Realidoid/project.properties
@@ -0,0 +1,11 @@
+# This file is automatically generated by Android Tools.
+# Do not modify this file -- YOUR CHANGES WILL BE ERASED!
+#
+# This file must be checked in Version Control Systems.
+#
+# To customize properties used by the Ant build system use,
+# "ant.properties", and override values to adapt the script to your
+# project structure.
+
+# Project target.
+target=android-10
BIN Realidoid/res/drawable-hdpi/ic_launcher.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN Realidoid/res/drawable-ldpi/ic_launcher.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN Realidoid/res/drawable-mdpi/ic_launcher.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 Realidoid/res/layout/main.xml
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:layout_width="fill_parent"
+ android:layout_height="fill_parent"
+ android:orientation="vertical" >
+
+ <TextView
+ android:layout_width="fill_parent"
+ android:layout_height="wrap_content"
+ android:text="@string/hello" />
+
+</LinearLayout>
7 Realidoid/res/values/strings.xml
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+ <string name="hello">Hello World, WikitudeTesteActivity!</string>
+ <string name="app_name">Realidoid</string>
+ <string name="application_key">{your_application_key_here}</string>
+ <string name="developer_name">{your_developername_here}</string>
+</resources>
92 Realidoid/src/br/com/androidnarede/realidoid/RealidoidActivity.java
@@ -0,0 +1,92 @@
+package br.com.androidnarede.realidoid;
+
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.List;
+
+import org.openintents.intents.WikitudeARIntent;
+import org.openintents.intents.WikitudePOI;
+
+import wikitude.teste.R;
+
+import android.app.Activity;
+import android.content.Context;
+import android.location.Address;
+import android.location.Geocoder;
+import android.location.Location;
+import android.location.LocationManager;
+import android.os.Bundle;
+import android.widget.Toast;
+
+/**
+ * Aplica‹o apresentada durante o
+ * AndroidConf Brasil 2011, que demonstra
+ * como integrar a Wikitude API em Android
+ * para criar uma aplica›es com realidade
+ * aumentada.
+ *
+ * @author ramonrabello
+ * @since 26 de Novembro de 2011
+ */
+public class RealidoidActivity extends Activity {
+
+ private WikitudeARIntent wikitudeIntent;
+ private List<WikitudePOI> pontosDeInteresse;
+
+ // infos de localiza‹o
+ private Location location;
+ private LocationManager locationManager;
+ private Double latitude;
+ private Double longitude;
+ private Double altitude;
+
+ @Override
+ public void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.main);
+ pontosDeInteresse = new ArrayList<WikitudePOI>();
+ locationManager = (LocationManager) getSystemService(Context.LOCATION_SERVICE);
+ location = locationManager.getLastKnownLocation(LocationManager.GPS_PROVIDER);
+
+ // se o GPS estiver ativo, captura a localizacao do aparelho,
+ // caso contr‡rio, simula uma localiza‹o
+ if (location != null){
+ latitude = location.getLatitude();
+ longitude = location.getLongitude();
+ altitude = location.getAltitude();
+ } else {
+ // simulando as coordenadas
+ latitude = -1.274309;
+ longitude = -48.501892;
+ altitude = location.getAltitude();
+ }
+
+ wikitudeIntent = new WikitudeARIntent(getApplication(),
+ getResources().getString(R.string.application_key),
+ getResources().getString(R.string.developer_name));
+ wikitudeIntent.addTitleText("Android na Rede");
+
+ Geocoder geocoder = new Geocoder(this);
+
+ try {
+
+ // recupera as ocorrncias dos endereos de acordo com a latitude e longitude do aparelho
+ List<Address> enderecos = geocoder.getFromLocation(latitude,
+ longitude, 10);
+
+ for (Address endereco : enderecos) {
+ WikitudePOI wikitudePoi = new WikitudePOI( latitude,
+ longitude,
+ altitude,
+ endereco.getFeatureName(),
+ endereco.getFeatureName() + ", " +
+ endereco.getCountryName() + " - " + endereco.getPostalCode() + "(" + endereco.getPhone() + ")");
+ pontosDeInteresse.add(wikitudePoi);
+ }
+ wikitudeIntent.addPOIs(pontosDeInteresse);
+ } catch (IOException e) {
+ Toast.makeText(this, "Erro ao obter localiza‹o!", Toast.LENGTH_LONG).show();
+ }
+ wikitudeIntent.startIntent(this);
+ }
+}

0 comments on commit a2a6321

Please sign in to comment.