François Gautrais 7 роки тому
батько
коміт
02771f0a27
28 змінених файлів з 185 додано та 49 видалено
  1. 4 3
      app/build.gradle
  2. 17 8
      app/src/main/java/app/mar/activities/ARActivity.java
  3. 3 0
      app/src/main/java/app/mar/activities/ImageViewerActivity.java
  4. 3 1
      app/src/main/java/app/mar/activities/MARMenuActivity.java
  5. 2 4
      app/src/main/java/app/mar/activities/MenuActivity.java
  6. 6 3
      app/src/main/java/app/mar/activities/PermissionActivity.java
  7. 2 1
      app/src/main/java/app/mar/activities/ResourceListActivity.java
  8. 1 0
      app/src/main/java/app/mar/activities/SettingsActivity.java
  9. 0 1
      app/src/main/java/app/mar/ui/CameraPreview.java
  10. 1 0
      app/src/main/java/app/mar/utils/AndroidResources.java
  11. 2 1
      app/src/main/java/app/mar/utils/ResourceManager.java
  12. 15 0
      app/src/main/java/app/mar/utils/SensorsManager.java
  13. 1 3
      app/src/main/java/app/mar/utils/files/FileManager.java
  14. 7 0
      app/src/main/java/app/mar/utils/game/Area.java
  15. 69 11
      app/src/main/java/app/mar/utils/game/Game.java
  16. 1 1
      app/src/main/java/app/mar/utils/game/Place.java
  17. 21 7
      app/src/main/java/app/mar/utils/game/Player.java
  18. BIN
      app/src/main/res/drawable/arrow_left.png
  19. BIN
      app/src/main/res/drawable/arrow_right.png
  20. BIN
      app/src/main/res/drawable/audio.png
  21. BIN
      app/src/main/res/drawable/background.png
  22. BIN
      app/src/main/res/drawable/fleche.png
  23. BIN
      app/src/main/res/drawable/togglebutton_off.png
  24. BIN
      app/src/main/res/drawable/togglebutton_on.png
  25. 7 0
      app/src/main/res/drawable/uibuttoncircle.xml
  26. 1 1
      app/src/main/res/layout/activity_ar.xml
  27. 19 3
      app/src/main/res/layout/activity_end.xml
  28. 3 1
      app/src/main/res/values/strings.xml

+ 4 - 3
app/build.gradle

@@ -3,11 +3,10 @@ apply plugin: 'com.android.application'
 android {
     compileSdkVersion 24
     buildToolsVersion "24.0.1"
-
     defaultConfig {
         applicationId "app.ara"
         minSdkVersion 14
-        targetSdkVersion 24
+        targetSdkVersion 14
         versionCode 1
         versionName "alpha 1.0"
     }
@@ -17,10 +16,12 @@ android {
             proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
         }
     }
+    productFlavors {
+    }
 }
 
 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 'com.android.support:support-v4:24.1.1'

+ 17 - 8
app/src/main/java/app/mar/activities/ARActivity.java

@@ -79,7 +79,6 @@ public class ARActivity extends RendererActivity
 
 
         cameraPreviewLayout = (FrameLayout)findViewById(R.id.camera_preview);
-        Log.e("____", "Camera:");
         camera = checkDeviceCamera();
         mImageSurfaceView = new CameraPreview(ARActivity.this, camera);
 
@@ -98,10 +97,8 @@ public class ARActivity extends RendererActivity
         Camera mCamera = null;
         try {
             mCamera = Camera.open();
-            Log.e("____", "Camera OK "+mCamera);
 
         } catch (Exception e) {
-            Log.e("____", "Camera Fail "+mCamera);
             e.printStackTrace();
         }
         return mCamera;
@@ -224,17 +221,19 @@ public class ARActivity extends RendererActivity
             double theta = -(-mGame.getPlayer().getOrientationY() + 135 - (0.5 * Math.atan(p.getDistance(mGame.getPlayer()) / 1.6) * 180 / Math.PI) % 360);
             while (theta < -180) theta += 360;
             while (theta > 180) theta -= 360;
-
             oo.position().y = -25 + (float) (50 * Math.sin(-theta * Math.PI / 180.0));
 
             double alpha = ((float) (mGame.getPlayer().getAngleWith(p))-mGame.getPlayer().getOrientationX() );// - mGame.getPlayer().getOrientationZ();
             oo.position().z = -(float)(90*distCoef*Math.cos(alpha*Math.PI/180.0));
             oo.position().x = -(float) (90 * distCoef * Math.sin(alpha * Math.PI / 180.0));
 
+
+
             if (mGame.getmSettings().isAreaDebug()) {
 
                 toDisplay += "Azimuth: " + dts(alpha) + "°\nAngle:"+mGame.getPlayer().getAngleWith(p) +"\nPosition (" + dts(oo.position().x) + ", " + dts(oo.position().y)
                         + ", " + dts(oo.position().z) + ")\nAngle Rel:"+dts(alpha)+" : "+dts(mGame.getPlayer().getAngleWith(p))+" - "+dts(mGame.getPlayer().getOrientationX())+"\n";
+                toDisplay+=" oo = { "+oo.position().x+", "+oo.position().y+", "+oo.position().z+" }\n";
             }
         }else
         {
@@ -262,13 +261,21 @@ public class ARActivity extends RendererActivity
         scene.clear();
 
 
-        if(mGame.getmSettings().isAreaDebug())
+       // if(mGame.getmSettings().isAreaDebug())
         {
             ArrayList<Area> ar = mGame.getAreaNextToPlayer();
             String ttxt = "Zones trouvées:\n";
             for(int i=0; i<ar.size(); i++)
                 ttxt+="\t"+ar.get(i).getName()+"\n";
-            toDisplay+=ttxt+"\n";
+            toDisplay+=ttxt+"\n\n";
+            String str = "Stage : "+mGame.getCurrentStage()+"\nZones les plus proches ("+mGame.getCurrentStageAreas().size()+"):\n"+ "--->";
+            ArrayList<Area> arr = mGame.getCurrentStageAreas();
+            for(int i=0; i<arr.size(); i++)
+                if(mGame.getPlayer().getPosition()!=null)
+                    str+="\t"+arr.get(i).getName()+" : "+arr.get(i).getDistanceToNextPlace(mGame.getPlayer())+" m\n";
+                else
+                    str+="\t"+arr.get(i).getName()+" : ?\n";
+            toDisplay+=str+"\n";
 
         }
 
@@ -424,9 +431,11 @@ public class ARActivity extends RendererActivity
             mTvAngle.getHandler().post(new Runnable() {
                 public void run() {
                     NumberFormat formatter = new DecimalFormat("#0.0");
-                    mTvAngle.setText("X : "+formatter.format(mGame.getPlayer().getOrientation())+"°\nY : "+
+                    /*mTvAngle.setText("X : "+formatter.format(mGame.getPlayer().getOrientation())+"°\nY : "+
                             formatter.format(mGame.getPlayer().getOrientationY())
-                            +"°\nZ : "+formatter.format(mGame.getPlayer().getOrientationZ())+"°");
+                            +"°\nZ : "+formatter.format(mGame.getPlayer().getOrientationZ())+"°");*/
+
+
                 }
             });
 

+ 3 - 0
app/src/main/java/app/mar/activities/ImageViewerActivity.java

@@ -9,6 +9,7 @@ import android.view.View;
 import android.widget.Button;
 import android.widget.ImageView;
 import android.widget.TextView;
+import android.widget.Toast;
 
 import app.mar.utils.AndroidResources;
 import app.mar.utils.FontChangeCrawler;
@@ -59,10 +60,12 @@ public class ImageViewerActivity extends AppCompatActivity implements IViewerAct
             {
                 mContent=CONTENT_IMAGE;
                 Bitmap bmp=null;
+                Toast.makeText(this, "Chargement de '"+mResource.getName()+"'", Toast.LENGTH_SHORT).show();
                 try {
                     bmp = FileManager.openImage(this, mResource.getName());
                 } catch (Exception e) {
                     e.printStackTrace();
+                    Toast.makeText(this, "Impossible de charger '"+mResource.getName()+"'", Toast.LENGTH_LONG).show();
                 }
 
                 mImageView.setImageBitmap(bmp);

+ 3 - 1
app/src/main/java/app/mar/activities/MARMenuActivity.java

@@ -54,7 +54,9 @@ public class MARMenuActivity extends MenuActivity{
         float px = TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 70, r.getDisplayMetrics());
         moveView(mBMenu, 0, 0, mWidth, (int) px);
 
-        mGame.pickResource("aecolepublique");
+        //mGame.pickResource("intro", false);
+        //mGame.pickResource("a", false);
+        mGame.pickUpOtherResources();
 
     }
 }

+ 2 - 4
app/src/main/java/app/mar/activities/MenuActivity.java

@@ -43,7 +43,6 @@ public abstract class  MenuActivity extends Activity implements View.OnClickList
     protected Button mBSend;
     protected int mHOffset=0;
 
-
     protected  void refreshMenuStyle(){}
 
     protected void setUpMenuStyle(){}
@@ -98,8 +97,7 @@ public abstract class  MenuActivity extends Activity implements View.OnClickList
         setContentView(R.layout.activity_new_menu);
         mRootLayout = (RelativeLayout) findViewById(R.id.menu_root);
 
-
-        Game g = Game.load(this);
+        Game g = null;// Game.load(this);
         System.out.println( (g != null) + " == " + (mGame == null) );
         if (g != null && mGame == null) {
             mGame = g;
@@ -164,6 +162,7 @@ public abstract class  MenuActivity extends Activity implements View.OnClickList
     public void onInfoClick(View v) {
         Stage s = mGame.getCurrentStageObj();
         Resource r = (s!=null)?s.getResource(): null;
+
         Intent intent = AndroidResources.getViewerIntent(this, r);
         startActivity(intent);
     }
@@ -171,7 +170,6 @@ public abstract class  MenuActivity extends Activity implements View.OnClickList
 
     public void onSendClick(View v)
     {
-
         Stage s = mGame.getCurrentStageObj();
         boolean finished = mGame.nextStage();
 

+ 6 - 3
app/src/main/java/app/mar/activities/PermissionActivity.java

@@ -65,9 +65,12 @@ public class PermissionActivity extends AppCompatActivity {
                 != PackageManager.PERMISSION_GRANTED) {
             al.add(Manifest.permission.ACCESS_COARSE_LOCATION);
         } else m_nPerm--;
-
-        if(al.size()>0)ActivityCompat.requestPermissions(this,al.toArray(new String[m_nPerm]), ALL_PERMISSIONS);
-
+        try {
+            if (al.size() > 0)
+                ActivityCompat.requestPermissions(this, al.toArray(new String[m_nPerm]), ALL_PERMISSIONS);
+        }catch(Exception e) {
+            e.printStackTrace();
+        }
 
     }
 

+ 2 - 1
app/src/main/java/app/mar/activities/ResourceListActivity.java

@@ -71,8 +71,9 @@ public class ResourceListActivity extends Activity {
             ArrayList<Object> obs = new ArrayList<Object>();
             for(int i = 0; i< resources.size(); i++) {
                 obs.add("Étape "+i);
-                for(int j=0; j<resources.get(i).size(); j++)
+                for(int j=0; j<resources.get(i).size(); j++) {
                     obs.add(resources.get(i).get(j));
+                }
             }
             ResourceArrayAdapter aa;
             aa = new ResourceArrayAdapter(this, android.R.layout.simple_list_item_1, obs);

+ 1 - 0
app/src/main/java/app/mar/activities/SettingsActivity.java

@@ -101,6 +101,7 @@ public class SettingsActivity extends Activity implements OnToggleListener, View
                 new DialogInterface.OnClickListener() {
                     public void onClick(DialogInterface dialog, int id) {
                         Game.setGame(new Game("game_medium", context));
+                        mGame.pickUpOtherResources();
                         Toast.makeText(context, "Suppression effectuée", Toast.LENGTH_SHORT);
                         dialog.cancel();
                     }

+ 0 - 1
app/src/main/java/app/mar/ui/CameraPreview.java

@@ -20,7 +20,6 @@ public class CameraPreview extends SurfaceView implements SurfaceHolder.Callback
     public CameraPreview(Context context, Camera camera) {
         super(context);
         this.mCamera = camera;
-        Log.e("______", camera+" camera");
         this.mHolder = getHolder();
         this.mHolder.addCallback(this);
     }

+ 1 - 0
app/src/main/java/app/mar/utils/AndroidResources.java

@@ -53,6 +53,7 @@ public class AndroidResources {
     public static Intent getViewerIntent(Context c, Resource re)
     {
         Intent intent =null ;
+        System.err.println("Ici !!!!!!!!!!");
         if(re.isAudio() || re.isVideo())
             intent = new Intent(c, MediaViewerAcitvity.class);
         else if(re.is3D())

+ 2 - 1
app/src/main/java/app/mar/utils/ResourceManager.java

@@ -134,11 +134,12 @@ public class ResourceManager implements Serializable{
                 return true;
             }
         }
+
         for(int i=0; i<m_otherResources.size(); i++)
             if(m_otherResources.get(i).getName().compareTo(name)==0)
             {
                 mResourcesPickedUp.add(m_otherResources.get(i));
-                if(mResourcesAquiered.size()-1>=0)mResourcesAquiered.get(mResourcesAquiered.size()-1).add(m_otherResources.get(i));
+                if(mResourcesAquiered.size()>0)mResourcesAquiered.get(mResourcesAquiered.size()-1).add(m_otherResources.get(i));
             }
 
         return false;

+ 15 - 0
app/src/main/java/app/mar/utils/SensorsManager.java

@@ -14,6 +14,7 @@ import android.location.LocationManager;
 import android.os.Bundle;
 import android.provider.Settings;
 import android.support.v4.app.ActivityCompat;
+import android.widget.Toast;
 
 import app.mar.activities.ARActivity;
 import app.mar.activities.R;
@@ -47,6 +48,8 @@ public class SensorsManager implements SensorEventListener, LocationListener {
     private boolean mIsLocalised = false;
     private Activity mParent;
     private GpsStub mStub=null;
+    private boolean mHasAcceleromter = true;
+    private boolean mHasMagneticField = true;
 
     public float getAzimuth() {
         return mBufferX.average();
@@ -80,6 +83,14 @@ public class SensorsManager implements SensorEventListener, LocationListener {
         return new GPSPoint(mLongitude, mLatitude, mAccuracy);
     }
 
+    public boolean hasMagneticField() {
+        return mHasMagneticField;
+    }
+
+    public boolean hasAcceleromter() {
+        return mHasAcceleromter;
+    }
+
     public SensorsManager(Activity parent ){
         mParent = parent;
         mLocationManager = (LocationManager) parent.getSystemService(parent.LOCATION_SERVICE);
@@ -87,6 +98,10 @@ public class SensorsManager implements SensorEventListener, LocationListener {
         mSensorManager = (SensorManager) parent.getSystemService(parent.SENSOR_SERVICE);
         mAccelerometer = mSensorManager.getDefaultSensor(Sensor.TYPE_ACCELEROMETER);
         mMagnetometer = mSensorManager.getDefaultSensor(Sensor.TYPE_MAGNETIC_FIELD);
+
+        mHasMagneticField = mMagnetometer!=null;
+        mHasAcceleromter = mAccelerometer!=null;
+
         mBufferX = new SlideBuffer(app.mar.utils.Settings.getSettings().getSensorLatency());
         mBufferY = new SlideBuffer(app.mar.utils.Settings.getSettings().getSensorLatency());
         mBufferZ = new SlideBuffer(app.mar.utils.Settings.getSettings().getSensorLatency());

+ 1 - 3
app/src/main/java/app/mar/utils/files/FileManager.java

@@ -33,6 +33,7 @@ public class FileManager {
     public static InputStream openFile(Context a, String path) throws Exception {
         isInit();
         InputStream is = null;
+        System.err.println("ICIIIIIIIIIIIIII '"+path+"'");
         try {
             is = a.getAssets().open(path);
         } catch (IOException e) {
@@ -93,16 +94,13 @@ public class FileManager {
         for(int i=0; i<MEDIA_EXT.length; i++)
         {
             AssetFileDescriptor is = null;
-            Log.e("________", "Start");
             try {
                 is = a.getAssets().openFd(path+MEDIA_EXT[i]);
 
-                Log.e("________", "Recherche de vidéo: '"+path+MEDIA_EXT[i]+"' OK");
                 if(is!=null)
                     return is;
             } catch (IOException e) {
                 //e.printStackTrace();
-                Log.e("________", "Recherche de vidéo: '"+path+MEDIA_EXT[i]+"' FAIL");
             }
         }
         return null;

+ 7 - 0
app/src/main/java/app/mar/utils/game/Area.java

@@ -147,4 +147,11 @@ public class Area  implements Serializable {
                 min=mPlaces.get(i).getDistance(p);
         return min;
     }
+
+    public String toString(Player p)
+    {
+        String str = "";
+        str+="["+mName+" "+mPlaces.get(0).getDistance(p)+"m ]";
+        return str;
+    }
 }

+ 69 - 11
app/src/main/java/app/mar/utils/game/Game.java

@@ -1,8 +1,10 @@
 package app.mar.utils.game;
 
 import android.app.Activity;
+import android.app.admin.SystemUpdatePolicy;
 import android.content.Context;
 import android.util.Log;
+import android.widget.Toast;
 
 import org.json.JSONArray;
 import org.json.JSONException;
@@ -35,7 +37,7 @@ public class Game  implements Serializable {
     protected int              mNStages;
     protected int              mCurrentStage=0;
     protected Player           mPlayer;
-    protected ResourceManager  mResources;
+    public ResourceManager     mResources;
     protected String           mName;
     protected Settings         mSettings = new Settings();
     protected boolean          mFinished= false;
@@ -76,16 +78,29 @@ public class Game  implements Serializable {
             findMaxStage();
             mResources.set( getAllResources(), mNStages);
 
-
             nextStage();
         } catch (JSONException e) {
+            System.err.println("_________________ B\n");
             e.printStackTrace();
         }
 
         try {
+            System.err.println("_________________ C\n");
             mMap=root.getString("map");
         } catch (JSONException e) {
+            e.printStackTrace();
+            System.err.println("_________________ C\n");
+        }
+
+
+        if(!mPlayer.hasMagneticField() || !mPlayer.hasAcceleromter())
+        {
+            mSettings.setARMode(false);
+            if(!mPlayer.hasMagneticField()) Toast.makeText(act, "Votre dispositif n'a pas de boussole. Le mode RA ne peut fonctionner et a été désactivé", Toast.LENGTH_LONG).show();
+            else if(!mPlayer.hasAcceleromter()) Toast.makeText(act, "Votre dispositif n'a pas d'accélerometre. Le mode RA ne peut fonctionner et a été désactivé", Toast.LENGTH_LONG).show();
         }
+
+        System.err.println("___________||||| "+mCurrentStageAreas.size());
     }
 
     public Stage getCurrentStageObj()
@@ -134,7 +149,7 @@ public class Game  implements Serializable {
         mCurrentStage++;
         Log.e("------------", "Is Finished : "+mCurrentStage+" > "+mNStages+" = "+(mCurrentStage>mNStages));
         if(mCurrentStage>mNStages) return true;
-
+    System.out.println("La");
         loadStageAreasResources();
         mResources.nextStage(mCurrentStage);
 
@@ -149,6 +164,7 @@ public class Game  implements Serializable {
             if(mAreas.get(i).getStage() == mCurrentStage)
                 mCurrentStageAreas.add(mAreas.get(i));
         }
+        System.err.println("================================ ICI =======================" + mCurrentStageAreas.size());
     }
 
     public int currentAreasCount()
@@ -215,18 +231,33 @@ public class Game  implements Serializable {
      * @param name Le nom de la ressource
      * @return  true si l'étape est finie, sinon false
      */
-    public boolean pickResource(String name)
+    public boolean pickResource(String name, boolean otherRes)
     {
 
-        for (int j = 0; j < mCurrentStageAreas.size(); j++)
-            if (name.compareTo(mCurrentStageAreas.get(j).getName())==0) {
-                removeArea(j);
-            }
+        if(otherRes)
+        {
+            for (int j = 0; j < mCurrentStageAreas.size(); j++)
+                if (name.compareTo(mCurrentStageAreas.get(j).getName())==0) {
+                    removeArea(j);
+                }
+        }
         mResources.pickUpResource(name);
 
         return mCurrentStageAreas.size()==0;
     }
 
+
+    /**
+     * Récupere une ressource par son nom, sans besoin de localisation ou d'orientation
+     * @param name Le nom de la ressource
+     * @return  true si l'étape est finie, sinon false
+     */
+    public boolean pickResource(String name)
+    {
+
+        return pickResource(name, true);
+    }
+
     /**
      * Récupere toutes les ressources du jeu
      */
@@ -249,7 +280,7 @@ public class Game  implements Serializable {
     public String toString()
     {
         String out = "Game : "+super.toString();
-                out+="mAreas[]:\n";
+        out+="mAreas[]:\n";
         for(int i=0; i<mAreas.size(); i++)
             out+="\tmAres["+i+"] = "+mAreas.get(i).getJson().toString()+"\n";
         out+="\nmResourcesAcquired[] : \n";
@@ -265,6 +296,14 @@ public class Game  implements Serializable {
         return out;
     }
 
+    public String toString2()
+    {
+        String out = "Game : "+mResources.getResourceLeft()+" : "+mCurrentStageAreas+";";
+        ArrayList<Resource> arr= mResources.getResourceLeft();
+
+        return out+";";
+    }
+
 
     /**
      * Sauvegarde la partie (l'objet game)
@@ -326,6 +365,20 @@ public class Game  implements Serializable {
         return tmp;
     }
 
+    public void pickUpOtherResources()
+    {
+        ArrayList<Resource> r = mResources.getOtherResource();
+        for(int i=0; i<r.size(); i++) {
+            pickResource(r.get(i).getName(), false);
+        }
+    }
+
+
+    public ArrayList<Area> getCurrentStageAreas()
+    {
+        return mCurrentStageAreas;
+    }
+
     /**
      * Teste si le jeu est déja sauvé
      * @param context Le contexte
@@ -333,6 +386,7 @@ public class Game  implements Serializable {
      */
     public static boolean isSaved(Activity context)
     {
+
         boolean b = false;
         try {
             FileInputStream fis = context.openFileInput("data");
@@ -437,6 +491,7 @@ public class Game  implements Serializable {
     public ArrayList<LocatedResources> getResourcesNextToPlayer()
     {
         ArrayList<LocatedResources> r = new ArrayList<LocatedResources>();
+
         for(int i=0; i<mCurrentStageAreas.size(); i++)
         {
             //probleme de GPS..
@@ -522,6 +577,8 @@ public class Game  implements Serializable {
     public void newSensorManager(Activity act)
     {
         mPlayer.newSensorManager(act);
+        if(!mPlayer.hasMagneticField() || !mPlayer.hasAcceleromter())
+            mSettings.setARMode(false);
     }
 
     public ArrayList< ArrayList<Resource> > getResourceByStage()
@@ -556,7 +613,8 @@ public class Game  implements Serializable {
 
     public boolean canSendData() {
         Stage s =getCurrentStageObj();
-        if(s==null) return false;
+        if(s==null ) return false;
+        if(!s.isTransition()) return false;
         return mResources.getNResourceAquiredByStage()>=s.getNResourceStep() && !isFinished();
         //return mResources.getNResourceLeft()<s.getNResourceStep() && !isFinished();
     }
@@ -583,6 +641,6 @@ public class Game  implements Serializable {
             Log.e("---------------", "   '" + mResources.getResourceLeft().get(i).getName() + "'");
 
         }
-
     }
+
 }

+ 1 - 1
app/src/main/java/app/mar/utils/game/Place.java

@@ -70,7 +70,7 @@ public class Place  implements Serializable {
     public boolean isPlayerOn(Player p)
     {
         GPSPoint pp = p.getPosition();
-        if(pp==null) return false;
+        if(pp==null || p.getSensorsManager().getPosition()==null) return false;
 
         return mLocation.getDistanceWith(pp)<=mRadius+p.getSensorsManager().getPosition().getAccuracy();
     }

+ 21 - 7
app/src/main/java/app/mar/utils/game/Player.java

@@ -39,6 +39,13 @@ public class Player implements Serializable{
         mSensors.onPause();
     }
 
+    public boolean hasMagneticField() {
+        return mSensors.hasMagneticField();
+    }
+
+    public boolean hasAcceleromter() {
+        return mSensors.hasAcceleromter();
+    }
 
     public void onResume(ARActivity act)
     {
@@ -48,17 +55,19 @@ public class Player implements Serializable{
 
     public float getOrientation()
     {
-        return mSensors.getOrientation();
+        System.out.println("Orientation = "+mSensors.getOrientation()); return mSensors.getOrientation();
     }
 
     public float getOrientationX()
     {
-        return mSensors.getAzimuth();
+
+        System.out.println("Orientation x = "+mSensors.getAzimuth());return mSensors.getAzimuth();
     }
 
     public float getOrientationY()
     {
-        return mSensors.getAngleY();
+
+        System.out.println("Orientation y = "+mSensors.getAngleY()); return mSensors.getAngleY();
     }
 
 
@@ -106,25 +115,30 @@ public class Player implements Serializable{
 
     public GPSPoint getPosition()
     {
+        return mSensors.getPosition();
+        /*
         if(mState==STATE_SEARCHING || mSensors.useGpsStub())
             return mSensors.getPosition();
         else
             return mFreezedPosition;
+            */
     }
 
     public void freezePosition()
     {
-        mState=STATE_FOUND;
-        mFreezedPosition=mSensors.getPosition().copy();
+        return ;
+        /*mState=STATE_FOUND;
+        mFreezedPosition=mSensors.getPosition().copy();*/
     }
 
     public void freezePosition(GPSPoint target)
     {
-        if( mState==STATE_SEARCHING
+        return ;
+        /*if( mState==STATE_SEARCHING
                 || (mSensors.getPosition()!=null &&  mFreezedPosition!=null &&
                 mSensors.getPosition().getDistanceWith(target) < mFreezedPosition.getDistanceWith(target)))
             mFreezedPosition=mSensors.getPosition().copy();
-        mState=STATE_FOUND;
+        mState=STATE_FOUND;*/
     }
 
     public void releasePosition()

BIN
app/src/main/res/drawable/arrow_left.png


BIN
app/src/main/res/drawable/arrow_right.png


BIN
app/src/main/res/drawable/audio.png


BIN
app/src/main/res/drawable/background.png


BIN
app/src/main/res/drawable/fleche.png


BIN
app/src/main/res/drawable/togglebutton_off.png


BIN
app/src/main/res/drawable/togglebutton_on.png


+ 7 - 0
app/src/main/res/drawable/uibuttoncircle.xml

@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="utf-8"?>
+<selector xmlns:android="http://schemas.android.com/apk/res/android">
+  <item android:drawable="@drawable/bscanner_tap" android:state_enabled="false"/>
+  <item android:drawable="@drawable/bscanner_tap" android:state_pressed="true"/>
+  <item android:drawable="@drawable/bscanner_tap" android:state_focused="true"/>
+  <item android:drawable="@drawable/bscanner"/>
+</selector>

+ 1 - 1
app/src/main/res/layout/activity_ar.xml

@@ -54,7 +54,7 @@
                 android:layout_below="@+id/angle"
                 android:layout_marginLeft="10dp"
                 android:layout_marginTop="-20dp"
-                android:lines="10" />
+                android:lines="20" />
 
             <TextView
                 android:layout_width="match_parent"

+ 19 - 3
app/src/main/res/layout/activity_end.xml

@@ -27,10 +27,26 @@
         android:layout_height="70dp"
         android:text="FIN !"
         android:id="@+id/button8"
-        android:layout_alignParentTop="true"
-        android:layout_centerHorizontal="true"
         android:background="@drawable/title"
         android:textColor="@color/dull_4"
         android:textSize="30dp"
-        android:textStyle="bold" />
+        android:textStyle="bold"
+        android:layout_alignParentBottom="true"
+        android:layout_alignRight="@+id/textView2" />
+
+    <ProgressBar
+        style="?android:attr/progressBarStyleSmall"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:id="@+id/progressBar"
+        android:layout_alignParentTop="true"
+        android:layout_alignLeft="@+id/textView2" />
+
+    <CheckBox
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:text="New CheckBox"
+        android:id="@+id/checkBox"
+        android:layout_alignParentTop="true"
+        android:layout_toRightOf="@+id/progressBar" />
 </RelativeLayout>

+ 3 - 1
app/src/main/res/values/strings.xml

@@ -74,7 +74,9 @@
     <string name="gps_stub__">-1.67609 48.10663;-1.67918 48.10971;-1.67929 48.11128;-1.68026 48.11461;</string>
     <string name="gps_stub_brest">-4.4931557 48.3852982;-4.4907396 48.3822208;-4.4913189 48.3821055;-4.5009306 48.3812175;-4.4994088 48.3816246;-4.5001176 48.3829454;-4.4998877 48.3861891;-4.4993333 48.3843879;-4.4981522 48.3837466;-4.4940766 48.3855502;-4.4934548 48.3850800;-4.4920585 48.3832195;-4.4925920 48.3818895;-4.4974687 48.3831305;-4.4977893 48.3839475;-4.4936559 48.3832834;-4.4947957 48.3844682;-4.4944665 48.3851339;-4.4940462 48.3842496;-4.4926676 48.3835729;-4.4927382 48.3826774;-4.4972925 48.3835206;-4.4956640 48.3843096;-4.4980210 48.3844962;      </string>
     <string name="gps_stub_">-1.6636940 48.0955401 ;-1.6648474 48.0958025;-1.6649627 48.0958487;-1.6652739 48.0958718;-1.6658446 48.0954599;-1.6658503 48.0947939;-1.6649685 48.0953636;-1.6635852 48.0952597;-1.6637062 48.0954137;-1.6637927 48.0955215;-1.6639079 48.0956793;-1.6641270 48.0957178;-1.6642653 48.0956139;-1.6644785 48.0957216;</string>
-    <string name="gps_stub">-1.6552946 48.0210506;-1.6518083 48.0207201;-1.6584931 48.0200556;-1.6624308 48.0181617;-1.6538682 48.0224585;-1.6512439 48.0208696;-1.6510127 48.0213842;-1.6462995 48.0187739;-1.6507205 48.0179446;</string>
+    <string name="gps_stub_ok">-1.6552946 48.0210506;-1.6518083 48.0207201;-1.6584931 48.0200556;-1.6624308 48.0181617;-1.6538682 48.0224585;-1.6512439 48.0208696;-1.6510127 48.0213842;-1.6462995 48.0187739;-1.6507205 48.0179446;</string>
+    <string name="gps_stub">0.149136 45.62950;0.14952242 45.6295547;0.14933466 45.629711;0.14945268 45.6298713</string>
+
     <string name="gps_stub_se">-1.6552002 48.0214484;-1.6556532 48.0204598;-1.6552002 48.0214484;</string>
     <string name="title_activity_puzzle">PuzzleActivity</string>