// Path: app/src/main/java/eu/se_bastiaan/popcorntimeremote/models/ScanModel.java
// public class ScanModel implements Parcelable {
//     public String ip;
//     public String port;
//     public String user;
//     public String pass;
// 
//     @SuppressWarnings("unused")
//     public static final Parcelable.Creator<ScanModel> CREATOR = new Parcelable.Creator<ScanModel>() {
//         @Override
//         public ScanModel createFromParcel(Parcel in) {
//             return new ScanModel(in);
//         }
// 
//         @Override
//         public ScanModel[] newArray(int size) {
//             return new ScanModel[size];
//         }
//     };
// 
//     protected ScanModel(Parcel in) {
//         ip = in.readString();
//         port = in.readString();
//         user = in.readString();
//         pass = in.readString();
//     }
// 
//     @Override
//     public int describeContents() {
//         return 0;
//     }
// 
//     @Override
//     public void writeToParcel(Parcel dest, int flags) {
//         dest.writeString(ip);
//         dest.writeString(port);
//         dest.writeString(user);
//         dest.writeString(pass);
//     }
// 
// }


import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.ActionBarActivity;
import android.support.v7.app.AppCompatActivity;
import android.view.MenuItem;
import com.google.gson.Gson;
import com.google.zxing.BarcodeFormat;
import com.google.zxing.Result;
import java.util.Arrays;
import eu.se_bastiaan.popcorntimeremote.R;
import eu.se_bastiaan.popcorntimeremote.models.ScanModel;
import me.dm7.barcodescanner.zxing.ZXingScannerView;
package eu.se_bastiaan.popcorntimeremote.activities;





public class PairingScannerActivity extends AppCompatActivity implements ZXingScannerView.ResultHandler {

    public static Integer SCAN = 1440, SUCCESS = 1441;

    private ZXingScannerView scannerView;

    @Override
    public void onCreate(Bundle state) {
        super.onCreate(state);
        scannerView = new ZXingScannerView(this);
        setContentView(scannerView);
    }

    @Override
    public void onResume() {
        super.onResume();
        scannerView.setResultHandler(this);
        scannerView.startCamera();
    }

    @Override
    public void onPause() {
        super.onPause();
        scannerView.stopCamera();
    }

    @Override
    public void handleResult(Result rawResult) {
        try {
            String json = rawResult.getText();
            Gson gson = new Gson();
// Path: app/src/main/java/eu/se_bastiaan/popcorntimeremote/models/ScanModel.java
// public class ScanModel implements Parcelable {
//     public String ip;
//     public String port;
//     public String user;
//     public String pass;
// 
//     @SuppressWarnings("unused")
//     public static final Parcelable.Creator<ScanModel> CREATOR = new Parcelable.Creator<ScanModel>() {
//         @Override
//         public ScanModel createFromParcel(Parcel in) {
//             return new ScanModel(in);
//         }
// 
//         @Override
//         public ScanModel[] newArray(int size) {
//             return new ScanModel[size];
//         }
//     };
// 
//     protected ScanModel(Parcel in) {
//         ip = in.readString();
//         port = in.readString();
//         user = in.readString();
//         pass = in.readString();
//     }
// 
//     @Override
//     public int describeContents() {
//         return 0;
//     }
// 
//     @Override
//     public void writeToParcel(Parcel dest, int flags) {
//         dest.writeString(ip);
//         dest.writeString(port);
//         dest.writeString(user);
//         dest.writeString(pass);
//     }
// 
// }


// Path: app/src/main/java/eu/se_bastiaan/popcorntimeremote/activities/PairingScannerActivity.java
import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.ActionBarActivity;
import android.support.v7.app.AppCompatActivity;
import android.view.MenuItem;
import com.google.gson.Gson;
import com.google.zxing.BarcodeFormat;
import com.google.zxing.Result;
import java.util.Arrays;
import eu.se_bastiaan.popcorntimeremote.R;
import eu.se_bastiaan.popcorntimeremote.models.ScanModel;
import me.dm7.barcodescanner.zxing.ZXingScannerView;

package eu.se_bastiaan.popcorntimeremote.activities;





public class PairingScannerActivity extends AppCompatActivity implements ZXingScannerView.ResultHandler {

    public static Integer SCAN = 1440, SUCCESS = 1441;

    private ZXingScannerView scannerView;

    @Override
    public void onCreate(Bundle state) {
        super.onCreate(state);
        scannerView = new ZXingScannerView(this);
        setContentView(scannerView);
    }

    @Override
    public void onResume() {
        super.onResume();
        scannerView.setResultHandler(this);
        scannerView.startCamera();
    }

    @Override
    public void onPause() {
        super.onPause();
        scannerView.stopCamera();
    }

    @Override
    public void handleResult(Result rawResult) {
        try {
            String json = rawResult.getText();
            Gson gson = new Gson();
            ScanModel model = gson.fromJson(json, ScanModel.class);