// Path: Services/Services/app/src/main/java/qa/edu/qu/cse/cmps312/services/services/BinderService.java
// public class BinderService extends Service {
//     // Binder given to clients
//     private final IBinder mBinder = new LocalBinder();
//     // Random number generator
//     private final Random mGenerator = new Random();
// 
//     /**
//      * Class used for the client Binder.  Because we know this service always
//      * runs in the same process as its clients, we don't need to deal with IPC
//      * (Inter process communication).
//      */
//     public class LocalBinder extends Binder {
//         public BinderService getService() {
//             // Return this instance of LocalService so clients can call public methods
//             return BinderService.this;
//         }
//     }
// 
//     @Override
//     public IBinder onBind(Intent intent) {
//         return mBinder;
//     }
// 
//     /** method for clients */
//     public int getRandomNumber() {
//         return mGenerator.nextInt(100);
//     }
// }


import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
import android.content.ServiceConnection;
import android.os.IBinder;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.TextView;
import qa.edu.qu.cse.cmps312.services.services.BinderService;
package qa.edu.qu.cse.cmps312.services;



public class BinderBoundActivity extends AppCompatActivity {

    BinderService mService;
    boolean mBound = false;
    TextView mTextView;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_binder_bound);
        mTextView = (TextView)findViewById(R.id.random_textview);
    }

    @Override
    protected void onStart() {
        super.onStart();
        // Bind to LocalService
// Path: Services/Services/app/src/main/java/qa/edu/qu/cse/cmps312/services/services/BinderService.java
// public class BinderService extends Service {
//     // Binder given to clients
//     private final IBinder mBinder = new LocalBinder();
//     // Random number generator
//     private final Random mGenerator = new Random();
// 
//     /**
//      * Class used for the client Binder.  Because we know this service always
//      * runs in the same process as its clients, we don't need to deal with IPC
//      * (Inter process communication).
//      */
//     public class LocalBinder extends Binder {
//         public BinderService getService() {
//             // Return this instance of LocalService so clients can call public methods
//             return BinderService.this;
//         }
//     }
// 
//     @Override
//     public IBinder onBind(Intent intent) {
//         return mBinder;
//     }
// 
//     /** method for clients */
//     public int getRandomNumber() {
//         return mGenerator.nextInt(100);
//     }
// }


// Path: Services/Services/app/src/main/java/qa/edu/qu/cse/cmps312/services/BinderBoundActivity.java
import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
import android.content.ServiceConnection;
import android.os.IBinder;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.TextView;
import qa.edu.qu.cse.cmps312.services.services.BinderService;

package qa.edu.qu.cse.cmps312.services;



public class BinderBoundActivity extends AppCompatActivity {

    BinderService mService;
    boolean mBound = false;
    TextView mTextView;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_binder_bound);
        mTextView = (TextView)findViewById(R.id.random_textview);
    }

    @Override
    protected void onStart() {
        super.onStart();
        // Bind to LocalService
        Intent intent = new Intent(this, BinderService.class);