Initial commit
							
								
								
									
										1
									
								
								app/.gitignore
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						@@ -0,0 +1 @@
 | 
			
		||||
/build
 | 
			
		||||
							
								
								
									
										35
									
								
								app/build.gradle
									
									
									
									
									
										Normal file
									
								
							
							
						
						@@ -0,0 +1,35 @@
 | 
			
		||||
apply plugin: 'com.android.application'
 | 
			
		||||
apply plugin: 'com.google.gms.google-services'
 | 
			
		||||
 | 
			
		||||
android {
 | 
			
		||||
    compileSdkVersion 28
 | 
			
		||||
    defaultConfig {
 | 
			
		||||
        applicationId "at.smartshopper.smartshopper"
 | 
			
		||||
        minSdkVersion 19
 | 
			
		||||
        targetSdkVersion 28
 | 
			
		||||
        versionCode 1
 | 
			
		||||
        versionName "1.0"
 | 
			
		||||
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
 | 
			
		||||
    }
 | 
			
		||||
    buildTypes {
 | 
			
		||||
        release {
 | 
			
		||||
            minifyEnabled false
 | 
			
		||||
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
dependencies {
 | 
			
		||||
    implementation fileTree(dir: 'libs', include: ['*.jar'])
 | 
			
		||||
    implementation 'com.android.support:appcompat-v7:28.0.0'
 | 
			
		||||
    implementation 'com.android.support.constraint:constraint-layout:1.1.3'
 | 
			
		||||
    implementation 'com.android.support:design:28.0.0'
 | 
			
		||||
    testImplementation 'junit:junit:4.12'
 | 
			
		||||
    androidTestImplementation 'com.android.support.test:runner:1.0.2'
 | 
			
		||||
    androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
 | 
			
		||||
    implementation 'com.google.firebase:firebase-auth:16.1.0'
 | 
			
		||||
    implementation 'com.google.android.gms:play-services-auth:16.0.1'
 | 
			
		||||
    implementation 'com.firebaseui:firebase-ui-auth:4.1.0'
 | 
			
		||||
    // http://mvnrepository.com/artifact/postgresql/postgresql
 | 
			
		||||
    implementation group: 'postgresql', name: 'postgresql', version: '9.1-901.jdbc4'
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										55
									
								
								app/google-services.json
									
									
									
									
									
										Normal file
									
								
							
							
						
						@@ -0,0 +1,55 @@
 | 
			
		||||
{
 | 
			
		||||
  "project_info": {
 | 
			
		||||
    "project_number": "221332577314",
 | 
			
		||||
    "firebase_url": "https://test-667ca.firebaseio.com",
 | 
			
		||||
    "project_id": "test-667ca",
 | 
			
		||||
    "storage_bucket": "test-667ca.appspot.com"
 | 
			
		||||
  },
 | 
			
		||||
  "client": [
 | 
			
		||||
    {
 | 
			
		||||
      "client_info": {
 | 
			
		||||
        "mobilesdk_app_id": "1:221332577314:android:acb28f092122eb64",
 | 
			
		||||
        "android_client_info": {
 | 
			
		||||
          "package_name": "at.smartshopper.smartshopper"
 | 
			
		||||
        }
 | 
			
		||||
      },
 | 
			
		||||
      "oauth_client": [
 | 
			
		||||
        {
 | 
			
		||||
          "client_id": "221332577314-s875jesfrase013upk7koi349hkpc8nn.apps.googleusercontent.com",
 | 
			
		||||
          "client_type": 1,
 | 
			
		||||
          "android_info": {
 | 
			
		||||
            "package_name": "at.smartshopper.smartshopper",
 | 
			
		||||
            "certificate_hash": "5b45cd94564fa6ffa90ed08d38d1ad48dd64681c"
 | 
			
		||||
          }
 | 
			
		||||
        },
 | 
			
		||||
        {
 | 
			
		||||
          "client_id": "221332577314-oo8b4uqtlgj75e7u7o3qt1vc96prfv52.apps.googleusercontent.com",
 | 
			
		||||
          "client_type": 3
 | 
			
		||||
        }
 | 
			
		||||
      ],
 | 
			
		||||
      "api_key": [
 | 
			
		||||
        {
 | 
			
		||||
          "current_key": "AIzaSyDz7MzopErZ6paAIaGGJAGY8Lx9kly5q2k"
 | 
			
		||||
        }
 | 
			
		||||
      ],
 | 
			
		||||
      "services": {
 | 
			
		||||
        "analytics_service": {
 | 
			
		||||
          "status": 1
 | 
			
		||||
        },
 | 
			
		||||
        "appinvite_service": {
 | 
			
		||||
          "status": 2,
 | 
			
		||||
          "other_platform_oauth_client": [
 | 
			
		||||
            {
 | 
			
		||||
              "client_id": "221332577314-obp1h7tvcl0q0ajkdcrnv7o90v0ssdjd.apps.googleusercontent.com",
 | 
			
		||||
              "client_type": 3
 | 
			
		||||
            }
 | 
			
		||||
          ]
 | 
			
		||||
        },
 | 
			
		||||
        "ads_service": {
 | 
			
		||||
          "status": 2
 | 
			
		||||
        }
 | 
			
		||||
      }
 | 
			
		||||
    }
 | 
			
		||||
  ],
 | 
			
		||||
  "configuration_version": "1"
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										21
									
								
								app/proguard-rules.pro
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						@@ -0,0 +1,21 @@
 | 
			
		||||
# Add project specific ProGuard rules here.
 | 
			
		||||
# You can control the set of applied configuration files using the
 | 
			
		||||
# proguardFiles setting in build.gradle.
 | 
			
		||||
#
 | 
			
		||||
# For more details, see
 | 
			
		||||
#   http://developer.android.com/guide/developing/tools/proguard.html
 | 
			
		||||
 | 
			
		||||
# If your project uses WebView with JS, uncomment the following
 | 
			
		||||
# and specify the fully qualified class name to the JavaScript interface
 | 
			
		||||
# class:
 | 
			
		||||
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
 | 
			
		||||
#   public *;
 | 
			
		||||
#}
 | 
			
		||||
 | 
			
		||||
# Uncomment this to preserve the line number information for
 | 
			
		||||
# debugging stack traces.
 | 
			
		||||
#-keepattributes SourceFile,LineNumberTable
 | 
			
		||||
 | 
			
		||||
# If you keep the line number information, uncomment this to
 | 
			
		||||
# hide the original source file name.
 | 
			
		||||
#-renamesourcefileattribute SourceFile
 | 
			
		||||
@@ -0,0 +1,26 @@
 | 
			
		||||
package at.smartshopper.smartshopper;
 | 
			
		||||
 | 
			
		||||
import android.content.Context;
 | 
			
		||||
import android.support.test.InstrumentationRegistry;
 | 
			
		||||
import android.support.test.runner.AndroidJUnit4;
 | 
			
		||||
 | 
			
		||||
import org.junit.Test;
 | 
			
		||||
import org.junit.runner.RunWith;
 | 
			
		||||
 | 
			
		||||
import static org.junit.Assert.*;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Instrumented test, which will execute on an Android device.
 | 
			
		||||
 *
 | 
			
		||||
 * @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
 | 
			
		||||
 */
 | 
			
		||||
@RunWith(AndroidJUnit4.class)
 | 
			
		||||
public class ExampleInstrumentedTest {
 | 
			
		||||
    @Test
 | 
			
		||||
    public void useAppContext() {
 | 
			
		||||
        // Context of the app under test.
 | 
			
		||||
        Context appContext = InstrumentationRegistry.getTargetContext();
 | 
			
		||||
 | 
			
		||||
        assertEquals("at.smartshopper.smartshopper", appContext.getPackageName());
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										26
									
								
								app/src/main/AndroidManifest.xml
									
									
									
									
									
										Normal file
									
								
							
							
						
						@@ -0,0 +1,26 @@
 | 
			
		||||
<?xml version="1.0" encoding="utf-8"?>
 | 
			
		||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
 | 
			
		||||
    package="at.smartshopper.smartshopper">
 | 
			
		||||
    <uses-permission android:name="android.permission.INTERNET" />
 | 
			
		||||
    <application
 | 
			
		||||
        android:allowBackup="true"
 | 
			
		||||
        android:icon="@mipmap/ic_launcher"
 | 
			
		||||
        android:label="@string/app_name"
 | 
			
		||||
        android:roundIcon="@mipmap/ic_launcher_round"
 | 
			
		||||
        android:supportsRtl="true"
 | 
			
		||||
        android:theme="@style/AppTheme"
 | 
			
		||||
        android:usesCleartextTraffic="true">
 | 
			
		||||
        <activity android:name=".LoginActivity">
 | 
			
		||||
            <intent-filter>
 | 
			
		||||
                <action android:name="android.intent.action.MAIN" />
 | 
			
		||||
 | 
			
		||||
                <category android:name="android.intent.category.LAUNCHER" />
 | 
			
		||||
            </intent-filter>
 | 
			
		||||
        </activity>
 | 
			
		||||
        <activity
 | 
			
		||||
            android:name=".Dash"
 | 
			
		||||
            android:label="@string/title_activity_dash"
 | 
			
		||||
            android:theme="@style/AppTheme.NoActionBar"></activity>
 | 
			
		||||
    </application>
 | 
			
		||||
 | 
			
		||||
</manifest>
 | 
			
		||||
							
								
								
									
										119
									
								
								app/src/main/java/at/smartshopper/smartshopper/Dash.java
									
									
									
									
									
										Normal file
									
								
							
							
						
						@@ -0,0 +1,119 @@
 | 
			
		||||
package at.smartshopper.smartshopper;
 | 
			
		||||
 | 
			
		||||
import android.net.Uri;
 | 
			
		||||
import android.os.Bundle;
 | 
			
		||||
import android.support.annotation.NonNull;
 | 
			
		||||
import android.support.v7.app.AppCompatActivity;
 | 
			
		||||
import android.support.v7.widget.LinearLayoutManager;
 | 
			
		||||
import android.support.v7.widget.RecyclerView;
 | 
			
		||||
import android.widget.TabHost;
 | 
			
		||||
 | 
			
		||||
import com.google.android.gms.tasks.OnCompleteListener;
 | 
			
		||||
import com.google.android.gms.tasks.Task;
 | 
			
		||||
import com.google.firebase.auth.FirebaseAuth;
 | 
			
		||||
import com.google.firebase.auth.FirebaseUser;
 | 
			
		||||
import com.google.firebase.auth.GetTokenResult;
 | 
			
		||||
 | 
			
		||||
import org.json.JSONException;
 | 
			
		||||
 | 
			
		||||
import java.util.List;
 | 
			
		||||
import java.util.jar.JarInputStream;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
public class Dash extends AppCompatActivity {
 | 
			
		||||
 | 
			
		||||
    private Database db = new Database();
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
    @Override
 | 
			
		||||
    protected void onCreate(Bundle savedInstanceState) {
 | 
			
		||||
        super.onCreate(savedInstanceState);
 | 
			
		||||
        setContentView(R.layout.activity_dash);
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
        tabHoster();
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
        /*
 | 
			
		||||
        Get userinformations
 | 
			
		||||
         */
 | 
			
		||||
        final FirebaseUser user = FirebaseAuth.getInstance().getCurrentUser();
 | 
			
		||||
        if (user != null) {
 | 
			
		||||
            // Name, email address, and profile photo Url
 | 
			
		||||
            String name = user.getDisplayName();
 | 
			
		||||
            String email = user.getEmail();
 | 
			
		||||
            Uri photoUrl = user.getPhotoUrl();
 | 
			
		||||
            RecyclerView ownRecycleView = (RecyclerView) findViewById(R.id.ownrecycler);
 | 
			
		||||
            ownRecycleView.setHasFixedSize(true);
 | 
			
		||||
            ownRecycleView.setLayoutManager(new LinearLayoutManager(this));
 | 
			
		||||
 | 
			
		||||
            // Check if user's email is verified
 | 
			
		||||
            boolean emailVerified = user.isEmailVerified();
 | 
			
		||||
 | 
			
		||||
            // The user's ID, unique to the Firebase project. Do NOT use this value to
 | 
			
		||||
            // authenticate with your backend server, if you have one. Use
 | 
			
		||||
            // FirebaseUser.getIdToken() instead.
 | 
			
		||||
            String uid = user.getUid();
 | 
			
		||||
 | 
			
		||||
            try {
 | 
			
		||||
                List<Shoppinglist> ownListsList = db.getMyShoppinglists(uid);
 | 
			
		||||
 | 
			
		||||
                ShoppinglistAdapter shpAdapter = new ShoppinglistAdapter(Dash.this, ownListsList);
 | 
			
		||||
 | 
			
		||||
                ownRecycleView.setAdapter(shpAdapter);
 | 
			
		||||
            }catch (JSONException e){
 | 
			
		||||
                e.printStackTrace();
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * Ist dafür Zuständig das es Tabs in der App gibt. Ohne dieser Funktion werden die Tabs nichtmehr Angezeigt.
 | 
			
		||||
     * Hier wird auch der Name der Tabs gesetzt
 | 
			
		||||
     */
 | 
			
		||||
    private void tabHoster() {
 | 
			
		||||
        TabHost host = (TabHost) findViewById(R.id.tabHost1);
 | 
			
		||||
        host.setup();
 | 
			
		||||
 | 
			
		||||
        //Tab 1
 | 
			
		||||
        TabHost.TabSpec spec = host.newTabSpec("Eigene Einkaufslisten");
 | 
			
		||||
        spec.setContent(R.id.tab1);
 | 
			
		||||
        spec.setIndicator("Eigene Einkaufslisten");
 | 
			
		||||
        host.addTab(spec);
 | 
			
		||||
 | 
			
		||||
        //Tab 2
 | 
			
		||||
        spec = host.newTabSpec("Geteilte Einkaufslisten");
 | 
			
		||||
        spec.setContent(R.id.tab2);
 | 
			
		||||
        spec.setIndicator("Geteilte Einkaufslisten");
 | 
			
		||||
        host.addTab(spec);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /*
 | 
			
		||||
    @Override
 | 
			
		||||
    public boolean onCreateOptionsMenu(Menu menu) {
 | 
			
		||||
        // Inflate the menu; this adds items to the action bar if it is present.
 | 
			
		||||
        getMenuInflater().inflate(R.menu.menu_main, menu);
 | 
			
		||||
        return true;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
    @Override
 | 
			
		||||
    public boolean onOptionsItemSelected(MenuItem item) {
 | 
			
		||||
        // Handle action bar item clicks here. The action bar will
 | 
			
		||||
        // automatically handle clicks on the Home/Up button, so long
 | 
			
		||||
        // as you specify a parent activity in AndroidManifest.xml.
 | 
			
		||||
        int id = item.getItemId();
 | 
			
		||||
 | 
			
		||||
        //noinspection SimplifiableIfStatement
 | 
			
		||||
        if (id == R.id.action_settings) {
 | 
			
		||||
            return true;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        return super.onOptionsItemSelected(item);
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
    */
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										67
									
								
								app/src/main/java/at/smartshopper/smartshopper/Database.java
									
									
									
									
									
										Normal file
									
								
							
							
						
						@@ -0,0 +1,67 @@
 | 
			
		||||
package at.smartshopper.smartshopper;
 | 
			
		||||
 | 
			
		||||
import android.os.StrictMode;
 | 
			
		||||
import android.util.Log;
 | 
			
		||||
 | 
			
		||||
import org.json.JSONException;
 | 
			
		||||
import org.json.JSONObject;
 | 
			
		||||
 | 
			
		||||
import java.sql.Connection;
 | 
			
		||||
import java.sql.DriverManager;
 | 
			
		||||
import java.sql.PreparedStatement;
 | 
			
		||||
import java.sql.ResultSet;
 | 
			
		||||
import java.sql.SQLException;
 | 
			
		||||
import java.sql.Statement;
 | 
			
		||||
import java.util.ArrayList;
 | 
			
		||||
import java.util.List;
 | 
			
		||||
 | 
			
		||||
public class Database {
 | 
			
		||||
 | 
			
		||||
    private Connection conect;
 | 
			
		||||
    final String HOST = "188.166.124.80";
 | 
			
		||||
    final String DB_NAME = "smartshopperdb";
 | 
			
		||||
    final String USERNAME = "smartshopper-user";
 | 
			
		||||
    final String PASSWORD = "jW^v#&LjNY_b3-k*jYj!U4Xz?T??m_D6249XAeWZ#7C^FRbKm!c_Dt+qj@4&a-Hs";
 | 
			
		||||
    final int PORT = 5432;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
    public  Database(){};
 | 
			
		||||
    public void  connectDatabase() throws SQLException {
 | 
			
		||||
        StrictMode.ThreadPolicy policy = new StrictMode.ThreadPolicy.Builder().permitAll().build();
 | 
			
		||||
        StrictMode.setThreadPolicy(policy);
 | 
			
		||||
        DriverManager.registerDriver(new org.postgresql.Driver());
 | 
			
		||||
        conect = DriverManager.getConnection("jdbc:postgresql://" + HOST + ":" + PORT + "/" + DB_NAME, USERNAME, PASSWORD);
 | 
			
		||||
 | 
			
		||||
        System.out.println("Database connected!");
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public List<Shoppinglist> getMyShoppinglists(String uid) throws JSONException {
 | 
			
		||||
        try {
 | 
			
		||||
            connectDatabase();
 | 
			
		||||
        } catch (SQLException e) {
 | 
			
		||||
            e.printStackTrace();
 | 
			
		||||
        }
 | 
			
		||||
        String SQL = "SELECT row_to_json(\"Shoppinglist\") AS obj FROM \"Shoppinglist\" JOIN \"Shoppinglist_admin\" USING (sl_id) WHERE username = ?";
 | 
			
		||||
        ArrayList<Shoppinglist> shoppinglistsList = null;
 | 
			
		||||
        try (
 | 
			
		||||
                Statement stmt = conect.createStatement();
 | 
			
		||||
                PreparedStatement pstmt = conect.prepareStatement(SQL)) {
 | 
			
		||||
            pstmt.setString(1, uid);
 | 
			
		||||
            ResultSet rs = pstmt.executeQuery();
 | 
			
		||||
            System.out.println(uid);
 | 
			
		||||
                shoppinglistsList = new ArrayList<Shoppinglist>();
 | 
			
		||||
                while (rs.next()) {
 | 
			
		||||
                    String shoppinglist = rs.getString(1);
 | 
			
		||||
                    JSONObject jsonObject = new JSONObject(shoppinglist);
 | 
			
		||||
 | 
			
		||||
                    shoppinglistsList.add(new Shoppinglist(jsonObject.getString("sl_id"), jsonObject.getString("name"), jsonObject.getString("description"), jsonObject.getString("invitelink"), jsonObject.getString("color")));
 | 
			
		||||
                }
 | 
			
		||||
                Log.d("DATABASE SHOPPINGLISTS", shoppinglistsList.toString());
 | 
			
		||||
 | 
			
		||||
        } catch (SQLException ex) {
 | 
			
		||||
            System.out.println(ex.getMessage());
 | 
			
		||||
        }
 | 
			
		||||
        return (List<Shoppinglist>) shoppinglistsList;
 | 
			
		||||
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
@@ -0,0 +1,184 @@
 | 
			
		||||
package at.smartshopper.smartshopper;
 | 
			
		||||
 | 
			
		||||
import android.content.Intent;
 | 
			
		||||
import android.support.annotation.NonNull;
 | 
			
		||||
import android.support.design.widget.Snackbar;
 | 
			
		||||
import android.support.v7.app.AppCompatActivity;
 | 
			
		||||
import android.os.Bundle;
 | 
			
		||||
import android.util.Log;
 | 
			
		||||
import android.view.View;
 | 
			
		||||
import android.widget.Button;
 | 
			
		||||
import android.widget.TextView;
 | 
			
		||||
import android.widget.Toast;
 | 
			
		||||
 | 
			
		||||
import com.google.android.gms.auth.api.signin.GoogleSignIn;
 | 
			
		||||
import com.google.android.gms.auth.api.signin.GoogleSignInAccount;
 | 
			
		||||
import com.google.android.gms.auth.api.signin.GoogleSignInClient;
 | 
			
		||||
import com.google.android.gms.auth.api.signin.GoogleSignInOptions;
 | 
			
		||||
import com.google.android.gms.common.SignInButton;
 | 
			
		||||
import com.google.android.gms.common.api.ApiException;
 | 
			
		||||
import com.google.android.gms.tasks.OnCompleteListener;
 | 
			
		||||
import com.google.android.gms.tasks.Task;
 | 
			
		||||
import com.google.firebase.auth.AuthCredential;
 | 
			
		||||
import com.google.firebase.auth.AuthResult;
 | 
			
		||||
import com.google.firebase.auth.FirebaseAuth;
 | 
			
		||||
import com.google.firebase.auth.FirebaseUser;
 | 
			
		||||
import com.google.firebase.auth.GoogleAuthProvider;
 | 
			
		||||
 | 
			
		||||
public class LoginActivity extends AppCompatActivity {
 | 
			
		||||
 | 
			
		||||
    private static final String TAG = "SMASH";
 | 
			
		||||
    private static final int RC_SIGN_IN = 1;
 | 
			
		||||
    private FirebaseAuth mAuth;
 | 
			
		||||
 | 
			
		||||
    SignInButton button;
 | 
			
		||||
    GoogleSignInClient mGoogleSignInClient;
 | 
			
		||||
 | 
			
		||||
    @Override
 | 
			
		||||
    public void onActivityResult(int requestCode, int resultCode, Intent data) {
 | 
			
		||||
        super.onActivityResult(requestCode, resultCode, data);
 | 
			
		||||
 | 
			
		||||
        // Result returned from launching the Intent from GoogleSignInApi.getSignInIntent(...);
 | 
			
		||||
        if (requestCode == RC_SIGN_IN) {
 | 
			
		||||
            Task<GoogleSignInAccount> task = GoogleSignIn.getSignedInAccountFromIntent(data);
 | 
			
		||||
            try {
 | 
			
		||||
                // Google Sign In was successful, authenticate with Firebase
 | 
			
		||||
                GoogleSignInAccount account = task.getResult(ApiException.class);
 | 
			
		||||
                firebaseAuthWithGoogle(account);
 | 
			
		||||
            } catch (ApiException e) {
 | 
			
		||||
                // Google Sign In failed, update UI appropriately
 | 
			
		||||
                Log.w(TAG, "Google sign in failed", e);
 | 
			
		||||
                // ...
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    private void signInGoogle() {
 | 
			
		||||
        Intent signInIntent = mGoogleSignInClient.getSignInIntent();
 | 
			
		||||
        startActivityForResult(signInIntent, RC_SIGN_IN);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    private void goDash() {
 | 
			
		||||
        Intent intent = new Intent(this, Dash.class);
 | 
			
		||||
        startActivity(intent);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    private void signInEmail(String email, String password) {
 | 
			
		||||
        mAuth.signInWithEmailAndPassword(email, password)
 | 
			
		||||
                .addOnCompleteListener(this, new OnCompleteListener<AuthResult>() {
 | 
			
		||||
                    @Override
 | 
			
		||||
                    public void onComplete(@NonNull Task<AuthResult> task) {
 | 
			
		||||
                        if (task.isSuccessful()) {
 | 
			
		||||
                            // Sign in success, update UI with the signed-in user's information
 | 
			
		||||
                            Log.d(TAG, "signInWithEmail:success");
 | 
			
		||||
                            FirebaseUser user = mAuth.getCurrentUser();
 | 
			
		||||
                            goDash();
 | 
			
		||||
                        } else {
 | 
			
		||||
                            // If sign in fails, display a message to the user.
 | 
			
		||||
                            Log.w(TAG, "signInWithEmail:failure", task.getException());
 | 
			
		||||
                            Toast.makeText(LoginActivity.this, "Authentication failed.",
 | 
			
		||||
                                    Toast.LENGTH_SHORT).show();
 | 
			
		||||
                        }
 | 
			
		||||
 | 
			
		||||
                        // ...
 | 
			
		||||
                    }
 | 
			
		||||
                });
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    private void createAccount(String email, String password) {
 | 
			
		||||
        mAuth.createUserWithEmailAndPassword(email, password)
 | 
			
		||||
                .addOnCompleteListener(this, new OnCompleteListener<AuthResult>() {
 | 
			
		||||
                    @Override
 | 
			
		||||
                    public void onComplete(@NonNull Task<AuthResult> task) {
 | 
			
		||||
                        if (task.isSuccessful()) {
 | 
			
		||||
                            // Sign in success, update UI with the signed-in user's information
 | 
			
		||||
                            Log.d(TAG, "createUserWithEmail:success");
 | 
			
		||||
                            FirebaseUser user = mAuth.getCurrentUser();
 | 
			
		||||
                        } else {
 | 
			
		||||
                            // If sign in fails, display a message to the user.
 | 
			
		||||
                            Log.w(TAG, "createUserWithEmail:failure", task.getException());
 | 
			
		||||
                            Toast.makeText(LoginActivity.this, "Authentication failed.",
 | 
			
		||||
                                    Toast.LENGTH_SHORT).show();
 | 
			
		||||
                        }
 | 
			
		||||
 | 
			
		||||
                        // ...
 | 
			
		||||
                    }
 | 
			
		||||
                });
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    @Override
 | 
			
		||||
    protected void onCreate(Bundle savedInstanceState) {
 | 
			
		||||
        super.onCreate(savedInstanceState);
 | 
			
		||||
        setContentView(R.layout.activity_login);
 | 
			
		||||
        mAuth = FirebaseAuth.getInstance();
 | 
			
		||||
 | 
			
		||||
        Button loginEmailBtn = (Button) findViewById(R.id.loginEmailBtn);
 | 
			
		||||
        final TextView email = (TextView) findViewById(R.id.email);
 | 
			
		||||
        final TextView passwort = (TextView) findViewById(R.id.password);
 | 
			
		||||
        button = (SignInButton) findViewById(R.id.loginGoogleBtn);
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
        loginEmailBtn.setOnClickListener(new View.OnClickListener() {
 | 
			
		||||
            @Override
 | 
			
		||||
            public void onClick(View v) {
 | 
			
		||||
                String emailstr = email.getText().toString();
 | 
			
		||||
                String passwortstr = passwort.getText().toString();
 | 
			
		||||
                signInEmail(emailstr, passwortstr);
 | 
			
		||||
            }
 | 
			
		||||
        });
 | 
			
		||||
 | 
			
		||||
        button.setOnClickListener(new View.OnClickListener() {
 | 
			
		||||
            @Override
 | 
			
		||||
            public void onClick(View v) {
 | 
			
		||||
                signInGoogle();
 | 
			
		||||
            }
 | 
			
		||||
        });
 | 
			
		||||
 | 
			
		||||
        // Configure Google Sign In
 | 
			
		||||
        GoogleSignInOptions gso = new GoogleSignInOptions.Builder(GoogleSignInOptions.DEFAULT_SIGN_IN)
 | 
			
		||||
                .requestIdToken(getString(R.string.default_web_client_id))
 | 
			
		||||
                .requestEmail()
 | 
			
		||||
                .build();
 | 
			
		||||
 | 
			
		||||
        mGoogleSignInClient = GoogleSignIn.getClient(this, gso);
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    private void firebaseAuthWithGoogle(GoogleSignInAccount acct) {
 | 
			
		||||
        Log.d(TAG, "firebaseAuthWithGoogle:" + acct.getId());
 | 
			
		||||
 | 
			
		||||
        AuthCredential credential = GoogleAuthProvider.getCredential(acct.getIdToken(), null);
 | 
			
		||||
        mAuth.signInWithCredential(credential)
 | 
			
		||||
                .addOnCompleteListener(this, new OnCompleteListener<AuthResult>() {
 | 
			
		||||
                    @Override
 | 
			
		||||
                    public void onComplete(@NonNull Task<AuthResult> task) {
 | 
			
		||||
                        if (task.isSuccessful()) {
 | 
			
		||||
                            // Sign in success, update UI with the signed-in user's information
 | 
			
		||||
                            Log.d(TAG, "signInWithCredential:success");
 | 
			
		||||
                            FirebaseUser user = mAuth.getCurrentUser();
 | 
			
		||||
                            goDash();
 | 
			
		||||
                        } else {
 | 
			
		||||
                            // If sign in fails, display a message to the user.
 | 
			
		||||
                            Log.w(TAG, "signInWithCredential:failure", task.getException());
 | 
			
		||||
                            Snackbar.make(findViewById(R.id.email), "Authentication Failed.", Snackbar.LENGTH_SHORT).show();
 | 
			
		||||
 | 
			
		||||
                        }
 | 
			
		||||
 | 
			
		||||
                        // ...
 | 
			
		||||
                    }
 | 
			
		||||
                });
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    @Override
 | 
			
		||||
    public void onStart() {
 | 
			
		||||
        super.onStart();
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
        if(null != mAuth.getCurrentUser()){
 | 
			
		||||
            goDash();
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
@@ -0,0 +1,39 @@
 | 
			
		||||
package at.smartshopper.smartshopper;
 | 
			
		||||
 | 
			
		||||
public class Shoppinglist {
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
    private String sl_id, name, description, invitelink, color;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * Erstellt ein Object von Shoppinglist.
 | 
			
		||||
     * @param sl_id Shoppinglist ID
 | 
			
		||||
     * @param name Shoppinglist Name
 | 
			
		||||
     * @param description Shoppinglist Beschreibung
 | 
			
		||||
     * @param invitelink Shoppinglist Einladungslink
 | 
			
		||||
     * @param color Shoppinglist Farbe
 | 
			
		||||
     */
 | 
			
		||||
    public Shoppinglist(String sl_id, String name, String description, String invitelink, String color){
 | 
			
		||||
        this.sl_id = sl_id;
 | 
			
		||||
        this.name = name;
 | 
			
		||||
        this.description = description;
 | 
			
		||||
        this.invitelink = invitelink;
 | 
			
		||||
        this.color = color;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public String getSlId(){
 | 
			
		||||
        return this.sl_id;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public String getname(){
 | 
			
		||||
        return this.name;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public String getdescription(){return this.description;}
 | 
			
		||||
 | 
			
		||||
    public String getInvitelink(){return this.invitelink;}
 | 
			
		||||
 | 
			
		||||
    public String getcolor(){ return this.color;}
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
@@ -0,0 +1,87 @@
 | 
			
		||||
package at.smartshopper.smartshopper;
 | 
			
		||||
 | 
			
		||||
import android.content.Context;
 | 
			
		||||
import android.net.Uri;
 | 
			
		||||
import android.support.v7.widget.RecyclerView;
 | 
			
		||||
import android.view.LayoutInflater;
 | 
			
		||||
import android.view.View;
 | 
			
		||||
import android.view.ViewGroup;
 | 
			
		||||
import android.widget.ImageView;
 | 
			
		||||
import android.widget.TextView;
 | 
			
		||||
 | 
			
		||||
import com.google.firebase.auth.FirebaseAuth;
 | 
			
		||||
import com.google.firebase.auth.FirebaseUser;
 | 
			
		||||
 | 
			
		||||
import java.util.List;
 | 
			
		||||
 | 
			
		||||
public class ShoppinglistAdapter extends RecyclerView.Adapter<ShoppinglistAdapter.ShoppinglistViewHolder> {
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
    //this context we will use to inflate the layout
 | 
			
		||||
    private Context mCtx;
 | 
			
		||||
 | 
			
		||||
    //we are storing all the products in a list
 | 
			
		||||
    private List<Shoppinglist> shoppinglist;
 | 
			
		||||
 | 
			
		||||
    //getting the context and product list with constructor
 | 
			
		||||
    public ShoppinglistAdapter(Context mCtx, List<Shoppinglist> shoppinglist) {
 | 
			
		||||
        this.mCtx = mCtx;
 | 
			
		||||
        this.shoppinglist = shoppinglist;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    @Override
 | 
			
		||||
    public ShoppinglistViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
 | 
			
		||||
        //inflating and returning our view holder
 | 
			
		||||
        LayoutInflater inflater = LayoutInflater.from(mCtx);
 | 
			
		||||
        View view = inflater.inflate(R.layout.cardview, null);
 | 
			
		||||
        return new ShoppinglistViewHolder(view);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    @Override
 | 
			
		||||
    public void onBindViewHolder(ShoppinglistViewHolder holder, int position) {
 | 
			
		||||
        //getting the product of the specified position
 | 
			
		||||
        Shoppinglist shoppinglist = this.shoppinglist.get(position);
 | 
			
		||||
 | 
			
		||||
        //binding the data with the viewholder views
 | 
			
		||||
        holder.textViewTitle.setText(shoppinglist.getname());
 | 
			
		||||
        System.out.println(shoppinglist.getname());
 | 
			
		||||
        holder.textViewBeschreibung.setText(shoppinglist.getdescription());
 | 
			
		||||
        FirebaseUser user = FirebaseAuth.getInstance().getCurrentUser();
 | 
			
		||||
        if (user != null) {
 | 
			
		||||
            // Name, email address, and profile photo Url
 | 
			
		||||
            String name = user.getDisplayName();
 | 
			
		||||
            Uri photoUrl = user.getPhotoUrl();
 | 
			
		||||
            holder.imageView.setImageURI(photoUrl);
 | 
			
		||||
 | 
			
		||||
            // Check if user's email is verified
 | 
			
		||||
 | 
			
		||||
            // The user's ID, unique to the Firebase project. Do NOT use this value to
 | 
			
		||||
            // authenticate with your backend server, if you have one. Use
 | 
			
		||||
            // FirebaseUser.getIdToken() instead.
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
    @Override
 | 
			
		||||
    public int getItemCount() {
 | 
			
		||||
        return shoppinglist.size();
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
    class ShoppinglistViewHolder extends RecyclerView.ViewHolder {
 | 
			
		||||
 | 
			
		||||
        TextView textViewTitle, textViewBeschreibung;
 | 
			
		||||
        ImageView imageView;
 | 
			
		||||
 | 
			
		||||
        public ShoppinglistViewHolder(View itemView) {
 | 
			
		||||
            super(itemView);
 | 
			
		||||
 | 
			
		||||
            textViewTitle = itemView.findViewById(R.id.shoppinglistName);
 | 
			
		||||
            textViewBeschreibung = itemView.findViewById(R.id.shoppinglistBeschreibung);
 | 
			
		||||
            imageView = itemView.findViewById(R.id.shoppinglistOwner);
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
@@ -0,0 +1,13 @@
 | 
			
		||||
package at.smartshopper.smartshopper;
 | 
			
		||||
 | 
			
		||||
import at.smartshopper.smartshopper.Shoppinglist;
 | 
			
		||||
 | 
			
		||||
public class Shoppinglists {
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
    public Shoppinglists(){
 | 
			
		||||
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										34
									
								
								app/src/main/res/drawable-v24/ic_launcher_foreground.xml
									
									
									
									
									
										Normal file
									
								
							
							
						
						@@ -0,0 +1,34 @@
 | 
			
		||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
 | 
			
		||||
    xmlns:aapt="http://schemas.android.com/aapt"
 | 
			
		||||
    android:width="108dp"
 | 
			
		||||
    android:height="108dp"
 | 
			
		||||
    android:viewportWidth="108"
 | 
			
		||||
    android:viewportHeight="108">
 | 
			
		||||
    <path
 | 
			
		||||
        android:fillType="evenOdd"
 | 
			
		||||
        android:pathData="M32,64C32,64 38.39,52.99 44.13,50.95C51.37,48.37 70.14,49.57 70.14,49.57L108.26,87.69L108,109.01L75.97,107.97L32,64Z"
 | 
			
		||||
        android:strokeWidth="1"
 | 
			
		||||
        android:strokeColor="#00000000">
 | 
			
		||||
        <aapt:attr name="android:fillColor">
 | 
			
		||||
            <gradient
 | 
			
		||||
                android:endX="78.5885"
 | 
			
		||||
                android:endY="90.9159"
 | 
			
		||||
                android:startX="48.7653"
 | 
			
		||||
                android:startY="61.0927"
 | 
			
		||||
                android:type="linear">
 | 
			
		||||
                <item
 | 
			
		||||
                    android:color="#44000000"
 | 
			
		||||
                    android:offset="0.0" />
 | 
			
		||||
                <item
 | 
			
		||||
                    android:color="#00000000"
 | 
			
		||||
                    android:offset="1.0" />
 | 
			
		||||
            </gradient>
 | 
			
		||||
        </aapt:attr>
 | 
			
		||||
    </path>
 | 
			
		||||
    <path
 | 
			
		||||
        android:fillColor="#FFFFFF"
 | 
			
		||||
        android:fillType="nonZero"
 | 
			
		||||
        android:pathData="M66.94,46.02L66.94,46.02C72.44,50.07 76,56.61 76,64L32,64C32,56.61 35.56,50.11 40.98,46.06L36.18,41.19C35.45,40.45 35.45,39.3 36.18,38.56C36.91,37.81 38.05,37.81 38.78,38.56L44.25,44.05C47.18,42.57 50.48,41.71 54,41.71C57.48,41.71 60.78,42.57 63.68,44.05L69.11,38.56C69.84,37.81 70.98,37.81 71.71,38.56C72.44,39.3 72.44,40.45 71.71,41.19L66.94,46.02ZM62.94,56.92C64.08,56.92 65,56.01 65,54.88C65,53.76 64.08,52.85 62.94,52.85C61.8,52.85 60.88,53.76 60.88,54.88C60.88,56.01 61.8,56.92 62.94,56.92ZM45.06,56.92C46.2,56.92 47.13,56.01 47.13,54.88C47.13,53.76 46.2,52.85 45.06,52.85C43.92,52.85 43,53.76 43,54.88C43,56.01 43.92,56.92 45.06,56.92Z"
 | 
			
		||||
        android:strokeWidth="1"
 | 
			
		||||
        android:strokeColor="#00000000" />
 | 
			
		||||
</vector>
 | 
			
		||||
							
								
								
									
										170
									
								
								app/src/main/res/drawable/ic_launcher_background.xml
									
									
									
									
									
										Normal file
									
								
							
							
						
						@@ -0,0 +1,170 @@
 | 
			
		||||
<?xml version="1.0" encoding="utf-8"?>
 | 
			
		||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
 | 
			
		||||
    android:width="108dp"
 | 
			
		||||
    android:height="108dp"
 | 
			
		||||
    android:viewportWidth="108"
 | 
			
		||||
    android:viewportHeight="108">
 | 
			
		||||
    <path
 | 
			
		||||
        android:fillColor="#008577"
 | 
			
		||||
        android:pathData="M0,0h108v108h-108z" />
 | 
			
		||||
    <path
 | 
			
		||||
        android:fillColor="#00000000"
 | 
			
		||||
        android:pathData="M9,0L9,108"
 | 
			
		||||
        android:strokeWidth="0.8"
 | 
			
		||||
        android:strokeColor="#33FFFFFF" />
 | 
			
		||||
    <path
 | 
			
		||||
        android:fillColor="#00000000"
 | 
			
		||||
        android:pathData="M19,0L19,108"
 | 
			
		||||
        android:strokeWidth="0.8"
 | 
			
		||||
        android:strokeColor="#33FFFFFF" />
 | 
			
		||||
    <path
 | 
			
		||||
        android:fillColor="#00000000"
 | 
			
		||||
        android:pathData="M29,0L29,108"
 | 
			
		||||
        android:strokeWidth="0.8"
 | 
			
		||||
        android:strokeColor="#33FFFFFF" />
 | 
			
		||||
    <path
 | 
			
		||||
        android:fillColor="#00000000"
 | 
			
		||||
        android:pathData="M39,0L39,108"
 | 
			
		||||
        android:strokeWidth="0.8"
 | 
			
		||||
        android:strokeColor="#33FFFFFF" />
 | 
			
		||||
    <path
 | 
			
		||||
        android:fillColor="#00000000"
 | 
			
		||||
        android:pathData="M49,0L49,108"
 | 
			
		||||
        android:strokeWidth="0.8"
 | 
			
		||||
        android:strokeColor="#33FFFFFF" />
 | 
			
		||||
    <path
 | 
			
		||||
        android:fillColor="#00000000"
 | 
			
		||||
        android:pathData="M59,0L59,108"
 | 
			
		||||
        android:strokeWidth="0.8"
 | 
			
		||||
        android:strokeColor="#33FFFFFF" />
 | 
			
		||||
    <path
 | 
			
		||||
        android:fillColor="#00000000"
 | 
			
		||||
        android:pathData="M69,0L69,108"
 | 
			
		||||
        android:strokeWidth="0.8"
 | 
			
		||||
        android:strokeColor="#33FFFFFF" />
 | 
			
		||||
    <path
 | 
			
		||||
        android:fillColor="#00000000"
 | 
			
		||||
        android:pathData="M79,0L79,108"
 | 
			
		||||
        android:strokeWidth="0.8"
 | 
			
		||||
        android:strokeColor="#33FFFFFF" />
 | 
			
		||||
    <path
 | 
			
		||||
        android:fillColor="#00000000"
 | 
			
		||||
        android:pathData="M89,0L89,108"
 | 
			
		||||
        android:strokeWidth="0.8"
 | 
			
		||||
        android:strokeColor="#33FFFFFF" />
 | 
			
		||||
    <path
 | 
			
		||||
        android:fillColor="#00000000"
 | 
			
		||||
        android:pathData="M99,0L99,108"
 | 
			
		||||
        android:strokeWidth="0.8"
 | 
			
		||||
        android:strokeColor="#33FFFFFF" />
 | 
			
		||||
    <path
 | 
			
		||||
        android:fillColor="#00000000"
 | 
			
		||||
        android:pathData="M0,9L108,9"
 | 
			
		||||
        android:strokeWidth="0.8"
 | 
			
		||||
        android:strokeColor="#33FFFFFF" />
 | 
			
		||||
    <path
 | 
			
		||||
        android:fillColor="#00000000"
 | 
			
		||||
        android:pathData="M0,19L108,19"
 | 
			
		||||
        android:strokeWidth="0.8"
 | 
			
		||||
        android:strokeColor="#33FFFFFF" />
 | 
			
		||||
    <path
 | 
			
		||||
        android:fillColor="#00000000"
 | 
			
		||||
        android:pathData="M0,29L108,29"
 | 
			
		||||
        android:strokeWidth="0.8"
 | 
			
		||||
        android:strokeColor="#33FFFFFF" />
 | 
			
		||||
    <path
 | 
			
		||||
        android:fillColor="#00000000"
 | 
			
		||||
        android:pathData="M0,39L108,39"
 | 
			
		||||
        android:strokeWidth="0.8"
 | 
			
		||||
        android:strokeColor="#33FFFFFF" />
 | 
			
		||||
    <path
 | 
			
		||||
        android:fillColor="#00000000"
 | 
			
		||||
        android:pathData="M0,49L108,49"
 | 
			
		||||
        android:strokeWidth="0.8"
 | 
			
		||||
        android:strokeColor="#33FFFFFF" />
 | 
			
		||||
    <path
 | 
			
		||||
        android:fillColor="#00000000"
 | 
			
		||||
        android:pathData="M0,59L108,59"
 | 
			
		||||
        android:strokeWidth="0.8"
 | 
			
		||||
        android:strokeColor="#33FFFFFF" />
 | 
			
		||||
    <path
 | 
			
		||||
        android:fillColor="#00000000"
 | 
			
		||||
        android:pathData="M0,69L108,69"
 | 
			
		||||
        android:strokeWidth="0.8"
 | 
			
		||||
        android:strokeColor="#33FFFFFF" />
 | 
			
		||||
    <path
 | 
			
		||||
        android:fillColor="#00000000"
 | 
			
		||||
        android:pathData="M0,79L108,79"
 | 
			
		||||
        android:strokeWidth="0.8"
 | 
			
		||||
        android:strokeColor="#33FFFFFF" />
 | 
			
		||||
    <path
 | 
			
		||||
        android:fillColor="#00000000"
 | 
			
		||||
        android:pathData="M0,89L108,89"
 | 
			
		||||
        android:strokeWidth="0.8"
 | 
			
		||||
        android:strokeColor="#33FFFFFF" />
 | 
			
		||||
    <path
 | 
			
		||||
        android:fillColor="#00000000"
 | 
			
		||||
        android:pathData="M0,99L108,99"
 | 
			
		||||
        android:strokeWidth="0.8"
 | 
			
		||||
        android:strokeColor="#33FFFFFF" />
 | 
			
		||||
    <path
 | 
			
		||||
        android:fillColor="#00000000"
 | 
			
		||||
        android:pathData="M19,29L89,29"
 | 
			
		||||
        android:strokeWidth="0.8"
 | 
			
		||||
        android:strokeColor="#33FFFFFF" />
 | 
			
		||||
    <path
 | 
			
		||||
        android:fillColor="#00000000"
 | 
			
		||||
        android:pathData="M19,39L89,39"
 | 
			
		||||
        android:strokeWidth="0.8"
 | 
			
		||||
        android:strokeColor="#33FFFFFF" />
 | 
			
		||||
    <path
 | 
			
		||||
        android:fillColor="#00000000"
 | 
			
		||||
        android:pathData="M19,49L89,49"
 | 
			
		||||
        android:strokeWidth="0.8"
 | 
			
		||||
        android:strokeColor="#33FFFFFF" />
 | 
			
		||||
    <path
 | 
			
		||||
        android:fillColor="#00000000"
 | 
			
		||||
        android:pathData="M19,59L89,59"
 | 
			
		||||
        android:strokeWidth="0.8"
 | 
			
		||||
        android:strokeColor="#33FFFFFF" />
 | 
			
		||||
    <path
 | 
			
		||||
        android:fillColor="#00000000"
 | 
			
		||||
        android:pathData="M19,69L89,69"
 | 
			
		||||
        android:strokeWidth="0.8"
 | 
			
		||||
        android:strokeColor="#33FFFFFF" />
 | 
			
		||||
    <path
 | 
			
		||||
        android:fillColor="#00000000"
 | 
			
		||||
        android:pathData="M19,79L89,79"
 | 
			
		||||
        android:strokeWidth="0.8"
 | 
			
		||||
        android:strokeColor="#33FFFFFF" />
 | 
			
		||||
    <path
 | 
			
		||||
        android:fillColor="#00000000"
 | 
			
		||||
        android:pathData="M29,19L29,89"
 | 
			
		||||
        android:strokeWidth="0.8"
 | 
			
		||||
        android:strokeColor="#33FFFFFF" />
 | 
			
		||||
    <path
 | 
			
		||||
        android:fillColor="#00000000"
 | 
			
		||||
        android:pathData="M39,19L39,89"
 | 
			
		||||
        android:strokeWidth="0.8"
 | 
			
		||||
        android:strokeColor="#33FFFFFF" />
 | 
			
		||||
    <path
 | 
			
		||||
        android:fillColor="#00000000"
 | 
			
		||||
        android:pathData="M49,19L49,89"
 | 
			
		||||
        android:strokeWidth="0.8"
 | 
			
		||||
        android:strokeColor="#33FFFFFF" />
 | 
			
		||||
    <path
 | 
			
		||||
        android:fillColor="#00000000"
 | 
			
		||||
        android:pathData="M59,19L59,89"
 | 
			
		||||
        android:strokeWidth="0.8"
 | 
			
		||||
        android:strokeColor="#33FFFFFF" />
 | 
			
		||||
    <path
 | 
			
		||||
        android:fillColor="#00000000"
 | 
			
		||||
        android:pathData="M69,19L69,89"
 | 
			
		||||
        android:strokeWidth="0.8"
 | 
			
		||||
        android:strokeColor="#33FFFFFF" />
 | 
			
		||||
    <path
 | 
			
		||||
        android:fillColor="#00000000"
 | 
			
		||||
        android:pathData="M79,19L79,89"
 | 
			
		||||
        android:strokeWidth="0.8"
 | 
			
		||||
        android:strokeColor="#33FFFFFF" />
 | 
			
		||||
</vector>
 | 
			
		||||
							
								
								
									
										4
									
								
								app/src/main/res/drawable/logo.xml
									
									
									
									
									
										Normal file
									
								
							
							
						
						@@ -0,0 +1,4 @@
 | 
			
		||||
<?xml version="1.0" encoding="utf-8"?>
 | 
			
		||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
 | 
			
		||||
 | 
			
		||||
</selector>
 | 
			
		||||
							
								
								
									
										108
									
								
								app/src/main/res/layout/activity_dash.xml
									
									
									
									
									
										Normal file
									
								
							
							
						
						@@ -0,0 +1,108 @@
 | 
			
		||||
<?xml version="1.0" encoding="utf-8"?>
 | 
			
		||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
 | 
			
		||||
    xmlns:app="http://schemas.android.com/apk/res-auto"
 | 
			
		||||
    xmlns:tools="http://schemas.android.com/tools"
 | 
			
		||||
    android:layout_width="match_parent"
 | 
			
		||||
    android:layout_height="match_parent"
 | 
			
		||||
    tools:context=".Dash">
 | 
			
		||||
 | 
			
		||||
    <TabHost
 | 
			
		||||
        android:id="@+id/tabHost1"
 | 
			
		||||
        android:layout_width="match_parent"
 | 
			
		||||
        android:layout_height="match_parent"
 | 
			
		||||
        android:layout_alignParentTop="true"
 | 
			
		||||
        android:layout_centerHorizontal="true">
 | 
			
		||||
 | 
			
		||||
        <LinearLayout
 | 
			
		||||
            android:layout_width="match_parent"
 | 
			
		||||
            android:layout_height="match_parent"
 | 
			
		||||
            android:orientation="vertical">
 | 
			
		||||
 | 
			
		||||
            <TabWidget
 | 
			
		||||
                android:id="@android:id/tabs"
 | 
			
		||||
                android:layout_width="match_parent"
 | 
			
		||||
                android:layout_height="wrap_content" />
 | 
			
		||||
 | 
			
		||||
            <FrameLayout
 | 
			
		||||
                android:id="@android:id/tabcontent"
 | 
			
		||||
                android:layout_width="match_parent"
 | 
			
		||||
                android:layout_height="match_parent">
 | 
			
		||||
 | 
			
		||||
                <LinearLayout
 | 
			
		||||
                    android:id="@+id/tab1"
 | 
			
		||||
                    android:layout_width="match_parent"
 | 
			
		||||
                    android:layout_height="match_parent"
 | 
			
		||||
                    android:gravity="center_horizontal"
 | 
			
		||||
                    android:orientation="vertical">
 | 
			
		||||
 | 
			
		||||
                    <LinearLayout
 | 
			
		||||
                        android:layout_width="match_parent"
 | 
			
		||||
                        android:layout_height="match_parent"
 | 
			
		||||
                        android:orientation="vertical">
 | 
			
		||||
 | 
			
		||||
                        <Button
 | 
			
		||||
                            android:id="@+id/logoutBtn"
 | 
			
		||||
                            android:layout_width="match_parent"
 | 
			
		||||
                            android:layout_height="wrap_content"
 | 
			
		||||
                            android:text="Logout" />
 | 
			
		||||
 | 
			
		||||
                        <TextView
 | 
			
		||||
                            android:id="@+id/textView"
 | 
			
		||||
                            android:layout_width="match_parent"
 | 
			
		||||
                            android:layout_height="wrap_content"
 | 
			
		||||
                            android:text="Eigene Einkaufslisten"
 | 
			
		||||
                            android:textAlignment="center"
 | 
			
		||||
                            android:textSize="18sp"
 | 
			
		||||
                            android:textStyle="bold" />
 | 
			
		||||
 | 
			
		||||
                        <android.support.v7.widget.RecyclerView
 | 
			
		||||
                            android:id="@+id/ownrecycler"
 | 
			
		||||
                            android:layout_width="match_parent"
 | 
			
		||||
                            android:layout_height="match_parent" />
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
                    </LinearLayout>
 | 
			
		||||
 | 
			
		||||
                </LinearLayout>
 | 
			
		||||
 | 
			
		||||
                <LinearLayout
 | 
			
		||||
                    android:id="@+id/tab2"
 | 
			
		||||
                    android:layout_width="match_parent"
 | 
			
		||||
                    android:layout_height="match_parent"
 | 
			
		||||
                    android:gravity="center_horizontal"
 | 
			
		||||
                    android:orientation="vertical">
 | 
			
		||||
 | 
			
		||||
                    <LinearLayout
 | 
			
		||||
                        android:layout_width="match_parent"
 | 
			
		||||
                        android:layout_height="match_parent"
 | 
			
		||||
                        android:orientation="vertical">
 | 
			
		||||
 | 
			
		||||
                        <Button
 | 
			
		||||
                            android:id="@+id/logoutBtn2"
 | 
			
		||||
                            android:layout_width="wrap_content"
 | 
			
		||||
                            android:layout_height="wrap_content"
 | 
			
		||||
                            android:text="Logout" />
 | 
			
		||||
 | 
			
		||||
                        <TextView
 | 
			
		||||
                            android:id="@+id/textView2"
 | 
			
		||||
                            android:layout_width="wrap_content"
 | 
			
		||||
                            android:layout_height="wrap_content"
 | 
			
		||||
                            android:text="Geteilte Einkaufslisten"
 | 
			
		||||
                            android:textAlignment="center"
 | 
			
		||||
                            android:textStyle="bold" />
 | 
			
		||||
 | 
			
		||||
                        <android.support.v7.widget.RecyclerView
 | 
			
		||||
                            android:id="@+id/sharedrecycler"
 | 
			
		||||
                            android:layout_width="match_parent"
 | 
			
		||||
                            android:layout_height="match_parent" />
 | 
			
		||||
 | 
			
		||||
                    </LinearLayout>
 | 
			
		||||
 | 
			
		||||
                </LinearLayout>
 | 
			
		||||
 | 
			
		||||
            </FrameLayout>
 | 
			
		||||
        </LinearLayout>
 | 
			
		||||
    </TabHost>
 | 
			
		||||
 | 
			
		||||
</LinearLayout>
 | 
			
		||||
							
								
								
									
										90
									
								
								app/src/main/res/layout/activity_login.xml
									
									
									
									
									
										Normal file
									
								
							
							
						
						@@ -0,0 +1,90 @@
 | 
			
		||||
<?xml version="1.0" encoding="utf-8"?>
 | 
			
		||||
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
 | 
			
		||||
    xmlns:app="http://schemas.android.com/apk/res-auto"
 | 
			
		||||
    xmlns:tools="http://schemas.android.com/tools"
 | 
			
		||||
    android:layout_width="match_parent"
 | 
			
		||||
    android:layout_height="match_parent"
 | 
			
		||||
    tools:context=".LoginActivity">
 | 
			
		||||
 | 
			
		||||
    <TableLayout
 | 
			
		||||
        android:layout_width="match_parent"
 | 
			
		||||
        android:layout_height="match_parent"
 | 
			
		||||
        android:gravity="center_horizontal"
 | 
			
		||||
        tools:layout_editor_absoluteX="8dp"
 | 
			
		||||
        tools:layout_editor_absoluteY="8dp">
 | 
			
		||||
 | 
			
		||||
        <TableRow
 | 
			
		||||
            android:layout_width="match_parent"
 | 
			
		||||
            android:layout_height="match_parent"
 | 
			
		||||
            android:gravity="center_horizontal"
 | 
			
		||||
            android:padding="7dp">
 | 
			
		||||
 | 
			
		||||
            <ImageView
 | 
			
		||||
                android:id="@+id/imageView"
 | 
			
		||||
                android:layout_width="wrap_content"
 | 
			
		||||
                android:layout_height="wrap_content"
 | 
			
		||||
                app:srcCompat="@mipmap/ic_launcher_round" />
 | 
			
		||||
        </TableRow>
 | 
			
		||||
 | 
			
		||||
        <TableRow
 | 
			
		||||
            android:layout_width="match_parent"
 | 
			
		||||
            android:layout_height="match_parent"
 | 
			
		||||
            android:gravity="center_horizontal">
 | 
			
		||||
 | 
			
		||||
            <EditText
 | 
			
		||||
                android:id="@+id/email"
 | 
			
		||||
                android:layout_width="match_parent"
 | 
			
		||||
                android:layout_height="wrap_content"
 | 
			
		||||
                android:ems="10"
 | 
			
		||||
                android:hint="Email"
 | 
			
		||||
                android:inputType="textEmailAddress"
 | 
			
		||||
                tools:layout_editor_absoluteX="33dp"
 | 
			
		||||
                tools:layout_editor_absoluteY="33dp" />
 | 
			
		||||
        </TableRow>
 | 
			
		||||
 | 
			
		||||
        <TableRow
 | 
			
		||||
            android:layout_width="match_parent"
 | 
			
		||||
            android:layout_height="match_parent"
 | 
			
		||||
            android:gravity="center_horizontal">
 | 
			
		||||
 | 
			
		||||
            <EditText
 | 
			
		||||
                android:id="@+id/password"
 | 
			
		||||
                android:layout_width="match_parent"
 | 
			
		||||
                android:layout_height="wrap_content"
 | 
			
		||||
                android:layout_marginStart="8dp"
 | 
			
		||||
                android:layout_marginEnd="8dp"
 | 
			
		||||
                android:ems="10"
 | 
			
		||||
                android:hint="Passwort"
 | 
			
		||||
                android:inputType="textPassword"
 | 
			
		||||
                app:layout_constraintEnd_toEndOf="parent"
 | 
			
		||||
                app:layout_constraintStart_toStartOf="parent"
 | 
			
		||||
                tools:layout_editor_absoluteY="232dp" />
 | 
			
		||||
        </TableRow>
 | 
			
		||||
        <TableRow
 | 
			
		||||
            android:layout_width="match_parent"
 | 
			
		||||
            android:layout_height="match_parent"
 | 
			
		||||
            android:gravity="center_horizontal">
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
            <Button
 | 
			
		||||
                android:id="@+id/loginEmailBtn"
 | 
			
		||||
                android:layout_width="match_parent"
 | 
			
		||||
                android:layout_height="wrap_content"
 | 
			
		||||
                android:text="Login Email" />
 | 
			
		||||
        </TableRow>
 | 
			
		||||
 | 
			
		||||
        <TableRow
 | 
			
		||||
            android:layout_width="match_parent"
 | 
			
		||||
            android:layout_height="match_parent"
 | 
			
		||||
            android:gravity="center_horizontal">
 | 
			
		||||
 | 
			
		||||
            <com.google.android.gms.common.SignInButton
 | 
			
		||||
                android:id="@+id/loginGoogleBtn"
 | 
			
		||||
                android:layout_width="wrap_content"
 | 
			
		||||
                android:layout_height="wrap_content"
 | 
			
		||||
                android:paddingTop="10dp" />
 | 
			
		||||
        </TableRow>
 | 
			
		||||
 | 
			
		||||
    </TableLayout>
 | 
			
		||||
 | 
			
		||||
</android.support.constraint.ConstraintLayout>
 | 
			
		||||
							
								
								
									
										51
									
								
								app/src/main/res/layout/cardview.xml
									
									
									
									
									
										Normal file
									
								
							
							
						
						@@ -0,0 +1,51 @@
 | 
			
		||||
<?xml version="1.0" encoding="utf-8"?>
 | 
			
		||||
<android.support.v7.widget.CardView xmlns:tools="http://schemas.android.com/tools"
 | 
			
		||||
    android:id="@+id/ownLists"
 | 
			
		||||
    xmlns:card_view="http://schemas.android.com/apk/res-auto"
 | 
			
		||||
    xmlns:android="http://schemas.android.com/apk/res/android"
 | 
			
		||||
    android:layout_width="match_parent"
 | 
			
		||||
    android:layout_height="wrap_content"
 | 
			
		||||
    card_view:cardUseCompatPadding="true"
 | 
			
		||||
    card_view:cardCornerRadius="8dp">
 | 
			
		||||
 | 
			
		||||
    <android.support.constraint.ConstraintLayout
 | 
			
		||||
        android:layout_width="match_parent"
 | 
			
		||||
        android:layout_height="match_parent">
 | 
			
		||||
 | 
			
		||||
        <ImageView
 | 
			
		||||
            android:id="@+id/shoppinglistOwner"
 | 
			
		||||
            android:layout_width="wrap_content"
 | 
			
		||||
            android:layout_height="wrap_content"
 | 
			
		||||
            android:layout_marginStart="8dp"
 | 
			
		||||
            android:layout_marginTop="8dp"
 | 
			
		||||
            tools:srcCompat="@drawable/common_google_signin_btn_icon_dark" />
 | 
			
		||||
 | 
			
		||||
        <TextView
 | 
			
		||||
            android:id="@+id/shoppinglistName"
 | 
			
		||||
            android:layout_width="wrap_content"
 | 
			
		||||
            android:layout_height="wrap_content"
 | 
			
		||||
            android:layout_marginStart="8dp"
 | 
			
		||||
            android:layout_marginTop="8dp"
 | 
			
		||||
            android:layout_marginEnd="8dp"
 | 
			
		||||
            android:text="Name"
 | 
			
		||||
            android:textSize="18sp"
 | 
			
		||||
            android:textStyle="bold"
 | 
			
		||||
            card_view:layout_constraintEnd_toEndOf="parent"
 | 
			
		||||
            card_view:layout_constraintStart_toStartOf="parent"
 | 
			
		||||
            card_view:layout_constraintTop_toTopOf="parent" />
 | 
			
		||||
 | 
			
		||||
        <TextView
 | 
			
		||||
            android:id="@+id/shoppinglistBeschreibung"
 | 
			
		||||
            android:layout_width="wrap_content"
 | 
			
		||||
            android:layout_height="wrap_content"
 | 
			
		||||
            android:layout_marginStart="8dp"
 | 
			
		||||
            android:layout_marginTop="8dp"
 | 
			
		||||
            android:layout_marginEnd="8dp"
 | 
			
		||||
            android:text="Beschreibung"
 | 
			
		||||
            card_view:layout_constraintEnd_toEndOf="parent"
 | 
			
		||||
            card_view:layout_constraintHorizontal_bias="0.498"
 | 
			
		||||
            card_view:layout_constraintStart_toStartOf="parent"
 | 
			
		||||
            card_view:layout_constraintTop_toBottomOf="@+id/shoppinglistName" />
 | 
			
		||||
    </android.support.constraint.ConstraintLayout>
 | 
			
		||||
 | 
			
		||||
</android.support.v7.widget.CardView>
 | 
			
		||||
							
								
								
									
										5
									
								
								app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml
									
									
									
									
									
										Normal file
									
								
							
							
						
						@@ -0,0 +1,5 @@
 | 
			
		||||
<?xml version="1.0" encoding="utf-8"?>
 | 
			
		||||
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
 | 
			
		||||
    <background android:drawable="@drawable/ic_launcher_background" />
 | 
			
		||||
    <foreground android:drawable="@drawable/ic_launcher_foreground" />
 | 
			
		||||
</adaptive-icon>
 | 
			
		||||
							
								
								
									
										5
									
								
								app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml
									
									
									
									
									
										Normal file
									
								
							
							
						
						@@ -0,0 +1,5 @@
 | 
			
		||||
<?xml version="1.0" encoding="utf-8"?>
 | 
			
		||||
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
 | 
			
		||||
    <background android:drawable="@drawable/ic_launcher_background" />
 | 
			
		||||
    <foreground android:drawable="@drawable/ic_launcher_foreground" />
 | 
			
		||||
</adaptive-icon>
 | 
			
		||||
							
								
								
									
										
											BIN
										
									
								
								app/src/main/res/mipmap-hdpi/ic_launcher.png
									
									
									
									
									
										Normal file
									
								
							
							
						
						| 
		 After Width: | Height: | Size: 2.9 KiB  | 
							
								
								
									
										
											BIN
										
									
								
								app/src/main/res/mipmap-hdpi/ic_launcher_round.png
									
									
									
									
									
										Normal file
									
								
							
							
						
						| 
		 After Width: | Height: | Size: 4.8 KiB  | 
							
								
								
									
										
											BIN
										
									
								
								app/src/main/res/mipmap-mdpi/ic_launcher.png
									
									
									
									
									
										Normal file
									
								
							
							
						
						| 
		 After Width: | Height: | Size: 2.0 KiB  | 
							
								
								
									
										
											BIN
										
									
								
								app/src/main/res/mipmap-mdpi/ic_launcher_round.png
									
									
									
									
									
										Normal file
									
								
							
							
						
						| 
		 After Width: | Height: | Size: 2.7 KiB  | 
							
								
								
									
										
											BIN
										
									
								
								app/src/main/res/mipmap-xhdpi/ic_launcher.png
									
									
									
									
									
										Normal file
									
								
							
							
						
						| 
		 After Width: | Height: | Size: 4.4 KiB  | 
							
								
								
									
										
											BIN
										
									
								
								app/src/main/res/mipmap-xhdpi/ic_launcher_round.png
									
									
									
									
									
										Normal file
									
								
							
							
						
						| 
		 After Width: | Height: | Size: 6.7 KiB  | 
							
								
								
									
										
											BIN
										
									
								
								app/src/main/res/mipmap-xxhdpi/ic_launcher.png
									
									
									
									
									
										Normal file
									
								
							
							
						
						| 
		 After Width: | Height: | Size: 6.2 KiB  | 
							
								
								
									
										
											BIN
										
									
								
								app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png
									
									
									
									
									
										Normal file
									
								
							
							
						
						| 
		 After Width: | Height: | Size: 10 KiB  | 
							
								
								
									
										
											BIN
										
									
								
								app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
									
									
									
									
									
										Normal file
									
								
							
							
						
						| 
		 After Width: | Height: | Size: 8.9 KiB  | 
							
								
								
									
										
											BIN
										
									
								
								app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png
									
									
									
									
									
										Normal file
									
								
							
							
						
						| 
		 After Width: | Height: | Size: 15 KiB  | 
							
								
								
									
										6
									
								
								app/src/main/res/values/colors.xml
									
									
									
									
									
										Normal file
									
								
							
							
						
						@@ -0,0 +1,6 @@
 | 
			
		||||
<?xml version="1.0" encoding="utf-8"?>
 | 
			
		||||
<resources>
 | 
			
		||||
    <color name="colorPrimary">#008577</color>
 | 
			
		||||
    <color name="colorPrimaryDark">#00574B</color>
 | 
			
		||||
    <color name="colorAccent">#880e4f</color>
 | 
			
		||||
</resources>
 | 
			
		||||
							
								
								
									
										3
									
								
								app/src/main/res/values/dimens.xml
									
									
									
									
									
										Normal file
									
								
							
							
						
						@@ -0,0 +1,3 @@
 | 
			
		||||
<resources>
 | 
			
		||||
    <dimen name="fab_margin">16dp</dimen>
 | 
			
		||||
</resources>
 | 
			
		||||
							
								
								
									
										4
									
								
								app/src/main/res/values/strings.xml
									
									
									
									
									
										Normal file
									
								
							
							
						
						@@ -0,0 +1,4 @@
 | 
			
		||||
<resources>
 | 
			
		||||
    <string name="app_name">SmartShopper</string>
 | 
			
		||||
    <string name="title_activity_dash">Dash</string>
 | 
			
		||||
</resources>
 | 
			
		||||
							
								
								
									
										20
									
								
								app/src/main/res/values/styles.xml
									
									
									
									
									
										Normal file
									
								
							
							
						
						@@ -0,0 +1,20 @@
 | 
			
		||||
<resources>
 | 
			
		||||
 | 
			
		||||
    <!-- Base application theme. -->
 | 
			
		||||
    <style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
 | 
			
		||||
        <!-- Customize your theme here. -->
 | 
			
		||||
        <item name="colorPrimary">@color/colorPrimary</item>
 | 
			
		||||
        <item name="colorPrimaryDark">@color/colorPrimaryDark</item>
 | 
			
		||||
        <item name="colorAccent">@color/colorAccent</item>
 | 
			
		||||
    </style>
 | 
			
		||||
 | 
			
		||||
    <style name="AppTheme.NoActionBar">
 | 
			
		||||
        <item name="windowActionBar">false</item>
 | 
			
		||||
        <item name="windowNoTitle">true</item>
 | 
			
		||||
    </style>
 | 
			
		||||
 | 
			
		||||
    <style name="AppTheme.AppBarOverlay" parent="ThemeOverlay.AppCompat.Dark.ActionBar" />
 | 
			
		||||
 | 
			
		||||
    <style name="AppTheme.PopupOverlay" parent="ThemeOverlay.AppCompat.Light" />
 | 
			
		||||
 | 
			
		||||
</resources>
 | 
			
		||||
@@ -0,0 +1,17 @@
 | 
			
		||||
package at.smartshopper.smartshopper;
 | 
			
		||||
 | 
			
		||||
import org.junit.Test;
 | 
			
		||||
 | 
			
		||||
import static org.junit.Assert.*;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Example local unit test, which will execute on the development machine (host).
 | 
			
		||||
 *
 | 
			
		||||
 * @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
 | 
			
		||||
 */
 | 
			
		||||
public class ExampleUnitTest {
 | 
			
		||||
    @Test
 | 
			
		||||
    public void addition_isCorrect() {
 | 
			
		||||
        assertEquals(4, 2 + 2);
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||