Skip to content

Commit

Permalink
Si tiene problemas es por la ruta de vuforia.jar
Browse files Browse the repository at this point in the history
-Todo lo que se lleva de pepsico a vuforia
  • Loading branch information
ValeFCF committed Aug 9, 2016
1 parent 1462af4 commit 6a73dc4
Show file tree
Hide file tree
Showing 55 changed files with 2,059 additions and 28 deletions.
1 change: 0 additions & 1 deletion .idea/.name

This file was deleted.

2 changes: 1 addition & 1 deletion .idea/compiler.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 1 addition & 6 deletions .idea/gradle.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

94 changes: 93 additions & 1 deletion .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 12 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,18 @@ android {
}

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile fileTree(include: ['*.jar'], dir: 'libs')
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:24.1.1'
compile files('C:/Users/salva/Documents/VuforiaAndroid/vuforia-sdk-android-5-5-9/build/java/vuforia/Vuforia.jar')
compile 'com.squareup.okhttp3:okhttp:3.2.0'
compile 'com.android.support:design:24.1.1'
compile files('/Users/Vale/Documents/GitHub/VuforiaAndroid/Vuforia.jar')
//compile 'junit:junit:4.12'
//compile 'com.amazonaws:aws-android-sdk-core:2.2.11'
//compile 'com.amazonaws:aws-android-sdk-cognito:2.2.11'
//compile 'com.amazonaws:aws-android-sdk-sns:2.2.11'
//compile 'com.google.android.gms:play-services-gcm:9.2.1'
compile 'com.android.support.constraint:constraint-layout:1.0.0-alpha4'


}
46 changes: 40 additions & 6 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,13 @@
android:description="@string/app_description"
android:launchMode="singleTask"
android:allowBackup="true"
android:theme="@style/SampleAppsTheme"
android:theme="@style/AppTheme"
android:largeHeap="true"
android:supportsRtl="true"
>



<!--
NOTE: The values in 'android:configChanges' ensure that Android will
not destroy and re-create the activity when the user flips the
Expand All @@ -90,11 +93,6 @@
android:screenOrientation="portrait"
android:noHistory="true"
>
<intent-filter>
<action android:name="android.intent.action.MAIN" />

<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>

<activity
Expand Down Expand Up @@ -184,6 +182,42 @@
>
</activity>


<!-- BEGIN - PEPSICO -->

<activity
android:name="com.devworms.pepsico.agendaActivity" />
<activity
android:name="com.devworms.pepsico.agendaDetalleActivity" />
<activity
android:name="com.devworms.pepsico.LoginActivity" />
<activity
android:name="com.devworms.pepsico.MainActivity"/>
<activity
android:name="com.devworms.pepsico.menuActActivity" />
<activity
android:name="com.devworms.pepsico.MenuPepsico" />
<activity
android:name="com.devworms.pepsico.PistasActivas" />
<activity
android:name="com.devworms.pepsico.Rally" />
<activity
android:name="com.devworms.pepsico.RallyCode"/>
<activity
android:name="com.devworms.pepsico.RegistroExito" />
<activity
android:name="com.devworms.pepsico.SplashInicioActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />

<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>

<!-- END - PEPSICO -->



</application>

</manifest>
89 changes: 89 additions & 0 deletions app/src/main/java/com/devworms/pepsico/ApiRest.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
package com.devworms.pepsico;


import android.os.AsyncTask;
import android.util.Log;

import com.devworms.pepsico.pojo.menuPojo;

import org.json.JSONArray;
import org.json.JSONObject;

import java.util.ArrayList;
import java.util.List;

import okhttp3.MediaType;
import okhttp3.OkHttpClient;
import okhttp3.Request;
import okhttp3.Response;


/**
* Created by sergio on 29/05/16.
*/
public class ApiRest {

public static List<menuPojo> consultarListadoMenu(String dia) {

List<menuPojo> lMenu = new ArrayList<menuPojo>();

try {
Log.d("RestApi","respuesta consulta");

OkHttpClient client = new OkHttpClient();

MediaType mediaType = MediaType.parse("application/octet-stream");
Request request = new Request.Builder()
.url("http://app-pepsico.palindromo.com.mx/APP/"+dia+".php")
.get()
.build();
JSONArray values = new RequestApi().execute(request).get();
Log.d("RestApi","respuesta "+ values.length());
for (int i = 0; i < values.length(); i++) {

JSONObject sensorApi = values.getJSONObject(i);
menuPojo menPojo = new menuPojo();
Log.d("RestApi","respuesta "+sensorApi.getString("id"));
menPojo.setId(sensorApi.getString("id"));
Log.d("RestApi","respuesta "+sensorApi.getString("nombre"));
menPojo.setNombre(sensorApi.getString("nombre"));
Log.d("RestApi","respuesta "+sensorApi.getString("salon"));
menPojo.setSalon(sensorApi.getString("salon"));
Log.d("RestApi","respuesta "+sensorApi.getString("horario"));
menPojo.setHorario(sensorApi.getString("horario"));
Log.d("RestApi","respuesta "+sensorApi.getString("codigo"));
menPojo.setCodigo(sensorApi.getString("codigo"));
Log.d("RestApi","respuesta "+sensorApi.getString("img"));
// menPojo.setRecomendaciones(sensorApi.getString("img"));
Log.d("RestApi","respuesta "+sensorApi.getString("dia"));
menPojo.setFecha(sensorApi.getString("dia"));
lMenu.add(menPojo);
}
}
catch (Exception ex){

}

return lMenu;
}

private static class RequestApi extends AsyncTask<Request, Void, JSONArray> {
@Override
protected JSONArray doInBackground(Request... params) {
try {

OkHttpClient client = new OkHttpClient();
Response response = client.newCall(params[0]).execute();

String string = response.body().string();
JSONArray jsonObjects = new JSONArray(string);

return jsonObjects;
} catch (Exception e) {
e.printStackTrace();
return null;
}

}
}
}
Loading

0 comments on commit 6a73dc4

Please sign in to comment.