These are chat archives for Trinea/android-open-project

19th
Sep 2017
Emmanuel Akodia
@akodiaemma
Sep 19 2017 10:53

hello world
so i am using zxing framewrk to make a qr scanner that works perfect
this is the code

package io.github.akodiaemmanuel.mapenziscanner;

import android.app.Activity;
import android.app.AlertDialog;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.util.Log;
import android.view.View;


import com.google.zxing.Result;

import me.dm7.barcodescanner.core.ViewFinderView;
import me.dm7.barcodescanner.zxing.ZXingScannerView;

/**
 * Created by Akodia Emmanuel on 9/18/2017.
 */

public class MainActivity extends Activity implements ZXingScannerView.ResultHandler {
    private ZXingScannerView mScannerview;

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity);
    }

    public void onClick(View v){
        mScannerview = new ZXingScannerView(this);
        setContentView(mScannerview);
        mScannerview.setResultHandler(this);
        mScannerview.startCamera();
    }
    @Override
    public void handleResult(Result result) {
//Do anything with the result here
        Log.w("handleResult",result.getText());
        AlertDialog.Builder builder = new AlertDialog.Builder(this);
        builder.setTitle("Scan Result");
        builder.setMessage(result.getText());
        AlertDialog alertDialog = builder.create();
        alertDialog.show();

        //resume scanning
        //mScannerview.resumeCameraPreview(this);
    }
}

i want to connect it to an online database so that i can append data into it...
any ideas