Son Forum Aktiviteleri

9
Tümünü Gör

Kullanıcıya ait forum aktivitesi bulunmamaktadır.

Eclipseden Android Studioya proje taşıma

picture-46073-1436252551.jpg
27 Ocak 2017 tarihinde cevaplandı

Eğer multidex hatası alıyorsan  compile ettigin librarylerden herhangi  ikisi çakışmaya sebeb oluyor 

exculude etmen gerekiyor 

dependencies {

compile fileTree(dir: 'libs', include: '*.jar')

compile project(':PhotoViewLibrary')
{

exclude group: 'com.android.support', module: 'support-annotations'

}

compile project(':QRCodeReaderLibrary')

exclude group: 'com.android.support', module: 'support-annotations' 

}

}

bu şekilde dene bide

Android Studio Root Komutlarını Nereden Ogrenebilirim?

picture-46073-1436252551.jpg
27 Ocak 2017 tarihinde cevaplandı

Burda adım adım anlatmış ingilizcen varsa az biraz halledersin 

https://forum.xda-developers.com/showthread.php?t=2684210

 

WebView Video Problemi

picture-46073-1436252551.jpg
27 Ocak 2017 tarihinde cevaplandı

package net.aniplus.aniplus;

import android.app.ProgressDialog;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.webkit.WebView;
import android.webkit.WebViewClient;
import android.widget.Toast;

public class MainActivity extends AppCompatActivity {
private MyWebChromeClient mWebChromeClient = null;
private View mCustomView;
private RelativeLayout mContentView;
private FrameLayout mCustomViewContainer;
private WebChromeClient.CustomViewCallback mCustomViewCallback;
    WebView webView;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        mWebChromeClient = new WMWebChromeClient();
        webView = (WebView) findViewById(R.id.webView);
        webView.setWebChromeClient(mWebChromeClient);
        webView.getSettings().setJavaScriptEnabled(true);
        webView.getSettings().setSupportZoom(true);
        webView.getSettings().setBuiltInZoomControls(true);
        webView.loadUrl("http://youtube.com");


        final ProgressDialog progressDialog=ProgressDialog.show(this, "Mobil Video İzle", "Bağlantınız Kontrol Ediliyor", true);
        progressDialog.show();

        webView.setWebViewClient(new WebViewClient() {
            @Override
            public void onPageFinished(WebView view, String url) {
                super.onPageFinished(view, url);
                Toast.makeText(MainActivity.this, "", Toast.LENGTH_SHORT).show();
                progressDialog.dismiss();
            }

            @Override
            public void onReceivedError(WebView view, int errorCode, String description, String failingUrl) {
                super.onReceivedError(view, errorCode, description, failingUrl);

                Toast.makeText(MainActivity.this, "Bir hata oluştur!", Toast.LENGTH_SHORT);
                progressDialog.dismiss();
            }
        });


    }
    @Override
    public void onBackPressed() {
    if (mCustomViewContainer != null)
        mWebChromeClient.onHideCustomView();
    else if (myWebView.canGoBack())
        myWebView.goBack();
    else
        super.onBackPressed();
}
private class MyWebChromeClient extends WebChromeClient {
    FrameLayout.LayoutParams LayoutParameters = new FrameLayout.LayoutParams(FrameLayout.LayoutParams.MATCH_PARENT,
            FrameLayout.LayoutParams.MATCH_PARENT);

    @Override
    public void onShowCustomView(View view, CustomViewCallback callback) {
        // if a view already exists then immediately terminate the new one
        if (mCustomView != null) {
            callback.onCustomViewHidden();
            return;
        }
        mContentView = (RelativeLayout) findViewById(R.id.activity_main);
        mContentView.setVisibility(View.GONE);
        mCustomViewContainer = new FrameLayout(MainActivity.this);
        mCustomViewContainer.setLayoutParams(LayoutParameters);
        mCustomViewContainer.setBackgroundResource(android.R.color.black);
        view.setLayoutParams(LayoutParameters);
        mCustomViewContainer.addView(view);
        mCustomView = view;
        mCustomViewCallback = callback;
        mCustomViewContainer.setVisibility(View.VISIBLE);
        setContentView(mCustomViewContainer);
    }

    @Override
    public void onHideCustomView() {
        if (mCustomView == null) {
            return;
        } else {
            // Hide the custom view.  
            mCustomView.setVisibility(View.GONE);
            // Remove the custom view from its container.  
            mCustomViewContainer.removeView(mCustomView);
            mCustomView = null;
            mCustomViewContainer.setVisibility(View.GONE);
            mCustomViewCallback.onCustomViewHidden();
            // Show the content view.  
            mContentView.setVisibility(View.VISIBLE);
            setContentView(mContentView);
        }
    }
}
}

Android Studio Spinner Click Olayı

picture-46073-1436252551.jpg
27 Ocak 2017 tarihinde cevaplandı

Spinner Spinner = (Spinner) findViewById(R.id.spinner);

Spinner.setOnItemSelectedListener(new OnItemSelectedListener() {

    public void onClick(View v) {
        // TODO Auto-generated method stub

    }

    @Override
    public void onItemSelected(AdapterView<?> arg0, View view,
            int position, long row_id) {
        final Intent intent;
        switch(position){
            case 1:
                intent = new Intent(CurrentActivity.this, TargetActivity1.class);
                break;
            case 2:
                intent = new Intent(CurrentActivity.this, TargetActivity2.class);
                break;
// and so on 
// .....

        }
        startActivity(intent);

    }

    @Override
    public void onNothingSelected(AdapterView<?> arg0) {
        // TODO Auto-generated method stub

    }

});

Android Maps Güncel konum alma

picture-46073-1436252551.jpg
22 Nisan 2016 tarihinde cevaplandı


private SensorManager sensorMan;

private Sensor accelerometer;

private float[] mGravity;

private float mAccel;

private float mAccelCurrent;

private float mAccelLast;
 

public class SeninActivity implements SensorEventListener


//onCreate methodu içinde

sensorMan = (SensorManager)getSystemService(SENSOR_SERVICE);

accelerometer = sensorMan.getDefaultSensor(Sensor.TYPE_ACCELEROMETER);

mAccel = 0.00f;

mAccelCurrent = SensorManager.GRAVITY_EARTH;

mAccelLast = SensorManager.GRAVITY_EARTH;
 


@Override

public void onResume() {

super.onResume();

sensorMan.registerListener(this, accelerometer, SensorManager.SENSOR_DELAY_UI);

}

@Override

protected void onPause() {

super.onPause();

sensorMan.unregisterListener(this);

}

@Override

public void onSensorChanged(SensorEvent event) {

if (event.sensor.getType() == Sensor.TYPE_ACCELEROMETER){

mGravity = event.values.clone();

// Shake detection float x = mGravity[0];

float y = mGravity[1];

float z = mGravity[2];

mAccelLast = mAccelCurrent;

mAccelCurrent = FloatMath.sqrt(x*x + y*y + z*z);

float delta = mAccelCurrent - mAccelLast; mAccel = mAccel * 0.9f + delta;

 if(mAccel > 1){

//burada location bilgilerini çagırabilirsin

}

}

}

@Override

public void onAccuracyChanged(Sensor sensor, int accuracy)

{ // required method }
 

umarım işine yarar...