Partage
  • Partager sur Facebook
  • Partager sur Twitter

E/Surface: getSlotFromBufferLocked: unknown buffer

Android studio 1.5.1

    31 mars 2016 à 22:08:13

    Svp, comment je peux corriger ces erreurs:

    03-31 15:42:46.339 422-428/? I/art: Debugger is no longer active
    03-31 15:42:46.343 422-422/? W/System: ClassLoader referenced unknown path: /data/app/com.example.getgpslocation-2/lib/x86
    03-31 15:42:46.988 422-435/? W/EGL_emulation: eglSurfaceAttrib not implemented
    03-31 15:42:46.988 422-435/? W/OpenGLRenderer: Failed to set EGL_SWAP_BEHAVIOR on surface 0xeead35a0, error=EGL_SUCCESS
    03-31 15:44:26.757 422-435/com.example.getgpslocation W/EGL_emulation: eglSurfaceAttrib not implemented
    03-31 15:44:26.757 422-435/com.example.getgpslocation W/OpenGLRenderer: Failed to set EGL_SWAP_BEHAVIOR on surface 0xe82bf5a0, error=EGL_SUCCESS
    03-31 15:44:26.809 422-435/com.example.getgpslocation E/Surface: getSlotFromBufferLocked: unknown buffer: 0xe8d837a0
    03-31 15:44:26.823 422-435/com.example.getgpslocation W/EGL_emulation: eglSurfaceAttrib not implemented
    03-31 15:44:26.823 422-435/com.example.getgpslocation W/OpenGLRenderer: Failed to set EGL_SWAP_BEHAVIOR on surface 0xe82bf5a0, error=EGL_SUCCESS
    03-31 15:44:26.848 422-435/com.example.getgpslocation V/RenderScript: 0xe087e000 Launching thread(s), CPUs 4
    03-31 15:44:30.224 422-435/com.example.getgpslocation E/Surface: getSlotFromBufferLocked: unknown buffer: 0xe8d838f0



    AndroidManifest.xml

    <?xml version="1.0" encoding="utf-8"?>
    <manifest xmlns:android="http://schemas.android.com/apk/res/android"
        package="com.example.getgpslocation"
        android:versionCode="1"
        android:versionName="1.0" >
    
        <uses-sdk
            android:minSdkVersion="8"
            android:targetSdkVersion="21" />
        
        <uses-permission 
            android:name="android.permission.ACCESS_FINE_LOCATION" />
        
        <uses-permission 
            android:name="android.permission.INTERNET" />
    
        <application
            android:allowBackup="true"
            android:icon="@drawable/ic_launcher"
            android:label="@string/app_name"
            android:theme="@style/AppTheme" >
            <activity
                android:name=".MainActivity"
                android:label="@string/app_name" >
                <intent-filter>
                    <action android:name="android.intent.action.MAIN" />
    
                    <category android:name="android.intent.category.LAUNCHER" />
                </intent-filter>
            </activity>
        </application>
    
    </manifest>

    activity_main.xml:

    <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
        xmlns:tools="http://schemas.android.com/tools"
        android:layout_width="match_parent"
        android:layout_height="match_parent" >
    
    	<Button 
    	    android:id="@+id/show_location"
    	    android:layout_width="wrap_content"
    	    android:layout_height="wrap_content"
    	    android:text="Show Location"
    	    android:layout_centerVertical="true"
    	    android:layout_centerHorizontal="true" />
    
    </RelativeLayout>

    GPSTracker.java:

    package com.example.getgpslocation;
    
    import android.app.AlertDialog;
    import android.app.Service;
    import android.content.Context;
    import android.content.DialogInterface;
    import android.content.Intent;
    import android.location.Location;
    import android.location.LocationListener;
    import android.location.LocationManager;
    import android.os.Bundle;
    import android.os.IBinder;
    import android.provider.Settings;
    import android.util.Log;
    
    public class GPSTracker extends Service implements LocationListener{
    
    	private final Context context;
    	
    	boolean isGPSEnabled = false;
    	boolean isNetworkEnabled = false;
    	boolean canGetLocation = false;
    	
    	Location location;
    	
    	double latitude;
    	double longitude;
    	
    	private static final long MIN_DISTANCE_CHANGE_FOR_UPDATES = 10;
    	private static final long MIN_TIME_BW_UPDATES = 1000 * 60 * 1;
    	
    	protected LocationManager locationManager;
    	
    	public GPSTracker(Context context) {
    		this.context = context;
    		getLocation();
    	}
    	
    	public Location getLocation() {
    		try {
    			locationManager = (LocationManager) context.getSystemService(LOCATION_SERVICE);
    			
    			isGPSEnabled = locationManager.isProviderEnabled(LocationManager.GPS_PROVIDER);
    			
    			isNetworkEnabled = locationManager.isProviderEnabled(LocationManager.NETWORK_PROVIDER);
    			
    			if(!isGPSEnabled && !isNetworkEnabled) {
    				
    			} else {
    				this.canGetLocation = true;
    				
    				if (isNetworkEnabled) {
    					
    					locationManager.requestLocationUpdates(
    							LocationManager.NETWORK_PROVIDER,
    							MIN_TIME_BW_UPDATES,
    							MIN_DISTANCE_CHANGE_FOR_UPDATES, this);
    
    					if (locationManager != null) {
    						location = locationManager
    								.getLastKnownLocation(LocationManager.NETWORK_PROVIDER);
    
    						if (location != null) {
    							
    							latitude = location.getLatitude();
    							longitude = location.getLongitude();
    						}
    					}
    
    				}
    				
    				if(isGPSEnabled) {
    					if(location == null) {
    						locationManager.requestLocationUpdates(
    								LocationManager.GPS_PROVIDER,
    								MIN_TIME_BW_UPDATES,
    								MIN_DISTANCE_CHANGE_FOR_UPDATES, this);
    						
    						if(locationManager != null) {
    							location = locationManager.getLastKnownLocation(LocationManager.GPS_PROVIDER);
    							
    							if(location != null) {
    								latitude = location.getLatitude();
    								longitude = location.getLongitude();
    							}
    						}
    					}
    				}
     			}
    			
    		} catch (Exception e) {
    			e.printStackTrace();
    		}
    		
    		return location;
    	}
    	
    	
    	public void stopUsingGPS() {
    		if(locationManager != null) {
    			locationManager.removeUpdates(GPSTracker.this);
    		}
    	}
    	
    	public double getLatitude() {
    		if(location != null) {
    			latitude = location.getLatitude();
    		}
    		return latitude;
    	}
    	
    	public double getLongitude() {
    		if(location != null) {
    			longitude = location.getLongitude();
    		}
    		
    		return longitude;
    	}
    	
    	public boolean canGetLocation() {
    		return this.canGetLocation;
    	}
    	
    	public void showSettingsAlert() {
    		AlertDialog.Builder alertDialog = new AlertDialog.Builder(context);
    		
    		alertDialog.setTitle("GPS is settings");
    		
    		alertDialog.setMessage("GPS is not enabled. Do you want to go to settings menu?");
    		
    		alertDialog.setPositiveButton("Settings", new DialogInterface.OnClickListener() {
    			
    			@Override
    			public void onClick(DialogInterface dialog, int which) {
    				Intent intent = new Intent(Settings.ACTION_LOCATION_SOURCE_SETTINGS);
    				context.startActivity(intent);
    			}
    		});
    		
    		alertDialog.setNegativeButton("Cancel", new DialogInterface.OnClickListener() {
    			
    			@Override
    			public void onClick(DialogInterface dialog, int which) {
    				dialog.cancel();
    			}
    		});
    		
    		alertDialog.show();
    	}
    	
    	@Override
    	public void onLocationChanged(Location arg0) {
    		// TODO Auto-generated method stub
    		
    	}
    
    	@Override
    	public void onProviderDisabled(String arg0) {
    		// TODO Auto-generated method stub
    		
    	}
    
    	@Override
    	public void onProviderEnabled(String arg0) {
    		// TODO Auto-generated method stub
    		
    	}
    
    	@Override
    	public void onStatusChanged(String arg0, int arg1, Bundle arg2) {
    		// TODO Auto-generated method stub
    		
    	}
    
    	@Override
    	public IBinder onBind(Intent intent) {
    		// TODO Auto-generated method stub
    		return null;
    	}
    
    }
    





    • Partager sur Facebook
    • Partager sur Twitter
      13 novembre 2020 à 17:12:57

      https://ubidots.com/community/t/solved-android-send-call-data-to-ubidots-etslotfrombufferlocked-unknown-buffer/334

       check this link for solution I hope its useful for you.

      Thank you,

      -
      Edité par MuhammadSaqib 13 novembre 2020 à 17:16:28

      • Partager sur Facebook
      • Partager sur Twitter

      E/Surface: getSlotFromBufferLocked: unknown buffer

      × Après avoir cliqué sur "Répondre" vous serez invité à vous connecter pour que votre message soit publié.
      × Attention, ce sujet est très ancien. Le déterrer n'est pas forcément approprié. Nous te conseillons de créer un nouveau sujet pour poser ta question.
      • Editeur
      • Markdown