├── app ├── .gitignore ├── src │ ├── main │ │ ├── ic_launcher-web.png │ │ ├── res │ │ │ ├── drawable-nodpi │ │ │ │ ├── home.png │ │ │ │ ├── star.png │ │ │ │ ├── a_avator.png │ │ │ │ ├── image1.jpg │ │ │ │ ├── image2.jpg │ │ │ │ ├── image3.jpg │ │ │ │ ├── image4.jpg │ │ │ │ ├── settings.png │ │ │ │ ├── twitter.png │ │ │ │ └── sharethis.png │ │ │ ├── mipmap-hdpi │ │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-mdpi │ │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-xhdpi │ │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-xxhdpi │ │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-xxxhdpi │ │ │ │ └── ic_launcher.png │ │ │ ├── drawable │ │ │ │ ├── text_cursor_cyan.xml │ │ │ │ ├── side_nav_bar.xml │ │ │ │ ├── ic_info_black_24dp.xml │ │ │ │ ├── ic_notifications_black_24dp.xml │ │ │ │ └── ic_sync_black_24dp.xml │ │ │ ├── values │ │ │ │ ├── colors.xml │ │ │ │ ├── dimens.xml │ │ │ │ ├── drawables.xml │ │ │ │ ├── styles.xml │ │ │ │ └── strings.xml │ │ │ ├── drawable-v21 │ │ │ │ ├── ic_menu_send.xml │ │ │ │ ├── ic_menu_slideshow.xml │ │ │ │ ├── ic_menu_gallery.xml │ │ │ │ ├── ic_menu_manage.xml │ │ │ │ ├── ic_menu_camera.xml │ │ │ │ └── ic_menu_share.xml │ │ │ ├── values-v21 │ │ │ │ └── styles.xml │ │ │ ├── values-w820dp │ │ │ │ └── dimens.xml │ │ │ ├── anim │ │ │ │ ├── anim_scale_in.xml │ │ │ │ └── anim_scale_out.xml │ │ │ ├── menu │ │ │ │ ├── main.xml │ │ │ │ └── activity_main_drawer.xml │ │ │ ├── layout │ │ │ │ ├── nav_header_main.xml │ │ │ │ ├── prompt_add_product.xml │ │ │ │ ├── activity_main.xml │ │ │ │ ├── content_list_users.xml │ │ │ │ ├── content_main.xml │ │ │ │ ├── content_supermarket_admin_products.xml │ │ │ │ ├── app_bar_main.xml │ │ │ │ ├── activity_list_users.xml │ │ │ │ ├── activity_add_product.xml │ │ │ │ ├── activity_admin_add_user.xml │ │ │ │ ├── activity_product_view.xml │ │ │ │ ├── activity_supermarket_admin_products.xml │ │ │ │ ├── content_product_view.xml │ │ │ │ ├── prices_list.xml │ │ │ │ ├── seller_list.xml │ │ │ │ ├── products_list.xml │ │ │ │ ├── activity_login.xml │ │ │ │ ├── activity_supermarket_admin.xml │ │ │ │ ├── users_list.xml │ │ │ │ ├── content_add_product.xml │ │ │ │ └── content_admin_add_user.xml │ │ │ └── xml │ │ │ │ ├── fab_icon_states.xml │ │ │ │ ├── pref_headers.xml │ │ │ │ ├── pref_data_sync.xml │ │ │ │ ├── pref_notification.xml │ │ │ │ └── pref_general.xml │ │ ├── java │ │ │ └── com │ │ │ │ └── kedevelopers │ │ │ │ └── supermarketprices │ │ │ │ ├── RequestInterface.java │ │ │ │ ├── Config.java │ │ │ │ ├── JSONResponse.java │ │ │ │ ├── Model │ │ │ │ ├── Product.java │ │ │ │ ├── SupermarketProduct.java │ │ │ │ └── User.java │ │ │ │ ├── AppController.java │ │ │ │ ├── CustomVolleyRequest.java │ │ │ │ ├── AppCompatPreferenceActivity.java │ │ │ │ ├── ListUsers.java │ │ │ │ ├── Adapter │ │ │ │ ├── ProductsAdapter.java │ │ │ │ ├── SupermarketPriceAdapter.java │ │ │ │ ├── UserAdapter.java │ │ │ │ └── SuperMarketProductAdapter.java │ │ │ │ ├── SupermarketAdminProducts.java │ │ │ │ ├── AdminAddUser.java │ │ │ │ ├── ProductView.java │ │ │ │ ├── AddProduct.java │ │ │ │ ├── MainActivity.java │ │ │ │ ├── SettingsActivity.java │ │ │ │ └── LoginActivity.java │ │ └── AndroidManifest.xml │ ├── test │ │ └── java │ │ │ └── com │ │ │ └── kedevelopers │ │ │ └── supermarketprices │ │ │ └── ExampleUnitTest.java │ └── androidTest │ │ └── java │ │ └── com │ │ └── kedevelopers │ │ └── supermarketprices │ │ └── ExampleInstrumentedTest.java ├── proguard-rules.pro └── build.gradle ├── settings.gradle ├── keystore.jks ├── .idea ├── copyright │ └── profiles_settings.xml ├── vcs.xml ├── modules.xml ├── runConfigurations.xml ├── gradle.xml ├── compiler.xml └── misc.xml ├── screenshots ├── supermarket.png └── supermarket1.png ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── .gitignore ├── README.md ├── gradle.properties ├── gradlew.bat └── gradlew /app/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /settings.gradle: -------------------------------------------------------------------------------- 1 | include ':app' 2 | -------------------------------------------------------------------------------- /keystore.jks: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bensonokiora/android-supermarket-price-comparison-app-/HEAD/keystore.jks -------------------------------------------------------------------------------- /.idea/copyright/profiles_settings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /screenshots/supermarket.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bensonokiora/android-supermarket-price-comparison-app-/HEAD/screenshots/supermarket.png -------------------------------------------------------------------------------- /screenshots/supermarket1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bensonokiora/android-supermarket-price-comparison-app-/HEAD/screenshots/supermarket1.png -------------------------------------------------------------------------------- /app/src/main/ic_launcher-web.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bensonokiora/android-supermarket-price-comparison-app-/HEAD/app/src/main/ic_launcher-web.png -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bensonokiora/android-supermarket-price-comparison-app-/HEAD/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /app/src/main/res/drawable-nodpi/home.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bensonokiora/android-supermarket-price-comparison-app-/HEAD/app/src/main/res/drawable-nodpi/home.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-nodpi/star.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bensonokiora/android-supermarket-price-comparison-app-/HEAD/app/src/main/res/drawable-nodpi/star.png -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.iml 2 | .gradle 3 | /local.properties 4 | /.idea/workspace.xml 5 | /.idea/libraries 6 | .DS_Store 7 | /build 8 | /captures 9 | .externalNativeBuild 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable-nodpi/a_avator.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bensonokiora/android-supermarket-price-comparison-app-/HEAD/app/src/main/res/drawable-nodpi/a_avator.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-nodpi/image1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bensonokiora/android-supermarket-price-comparison-app-/HEAD/app/src/main/res/drawable-nodpi/image1.jpg -------------------------------------------------------------------------------- /app/src/main/res/drawable-nodpi/image2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bensonokiora/android-supermarket-price-comparison-app-/HEAD/app/src/main/res/drawable-nodpi/image2.jpg -------------------------------------------------------------------------------- /app/src/main/res/drawable-nodpi/image3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bensonokiora/android-supermarket-price-comparison-app-/HEAD/app/src/main/res/drawable-nodpi/image3.jpg -------------------------------------------------------------------------------- /app/src/main/res/drawable-nodpi/image4.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bensonokiora/android-supermarket-price-comparison-app-/HEAD/app/src/main/res/drawable-nodpi/image4.jpg -------------------------------------------------------------------------------- /app/src/main/res/drawable-nodpi/settings.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bensonokiora/android-supermarket-price-comparison-app-/HEAD/app/src/main/res/drawable-nodpi/settings.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-nodpi/twitter.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bensonokiora/android-supermarket-price-comparison-app-/HEAD/app/src/main/res/drawable-nodpi/twitter.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bensonokiora/android-supermarket-price-comparison-app-/HEAD/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bensonokiora/android-supermarket-price-comparison-app-/HEAD/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-nodpi/sharethis.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bensonokiora/android-supermarket-price-comparison-app-/HEAD/app/src/main/res/drawable-nodpi/sharethis.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bensonokiora/android-supermarket-price-comparison-app-/HEAD/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bensonokiora/android-supermarket-price-comparison-app-/HEAD/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bensonokiora/android-supermarket-price-comparison-app-/HEAD/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/text_cursor_cyan.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /app/src/main/res/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #9C27B0 4 | #9C27B0 5 | #9C27B0 6 | 7 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Mon Dec 28 10:00:20 PST 2015 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-2.14.1-all.zip 7 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/side_nav_bar.xml: -------------------------------------------------------------------------------- 1 | 3 | 9 | -------------------------------------------------------------------------------- /app/src/main/res/drawable-v21/ic_menu_send.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/values-v21/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/values-w820dp/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 64dp 6 | 7 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_info_black_24dp.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/values/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 16dp 4 | 160dp 5 | 6 | 16dp 7 | 16dp 8 | 16dp 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable-v21/ic_menu_slideshow.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable-v21/ic_menu_gallery.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable-v21/ic_menu_manage.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_notifications_black_24dp.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/test/java/com/kedevelopers/supermarketprices/ExampleUnitTest.java: -------------------------------------------------------------------------------- 1 | package com.kedevelopers.supermarketprices; 2 | 3 | import org.junit.Test; 4 | 5 | import static org.junit.Assert.*; 6 | 7 | /** 8 | * Example local unit test, which will execute on the development machine (host). 9 | * 10 | * @see Testing documentation 11 | */ 12 | public class ExampleUnitTest { 13 | @Test 14 | public void addition_isCorrect() throws Exception { 15 | assertEquals(4, 2 + 2); 16 | } 17 | } -------------------------------------------------------------------------------- /.idea/modules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_sync_black_24dp.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | -------------------------------------------------------------------------------- /app/src/main/res/anim/anim_scale_in.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 11 | 12 | 16 | 17 | -------------------------------------------------------------------------------- /app/src/main/res/anim/anim_scale_out.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 11 | 12 | 16 | 17 | -------------------------------------------------------------------------------- /.idea/runConfigurations.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 11 | 12 | -------------------------------------------------------------------------------- /app/src/main/res/values/drawables.xml: -------------------------------------------------------------------------------- 1 | 2 | @android:drawable/ic_menu_camera 3 | @android:drawable/ic_menu_gallery 4 | @android:drawable/ic_menu_slideshow 5 | @android:drawable/ic_menu_manage 6 | @android:drawable/ic_menu_share 7 | @android:drawable/ic_menu_send 8 | 9 | -------------------------------------------------------------------------------- /app/src/main/res/drawable-v21/ic_menu_camera.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 12 | 13 | -------------------------------------------------------------------------------- /app/src/main/java/com/kedevelopers/supermarketprices/RequestInterface.java: -------------------------------------------------------------------------------- 1 | package com.kedevelopers.supermarketprices; 2 | 3 | /** 4 | * Created by BEN on 12/14/2016. 5 | */ 6 | 7 | import retrofit2.Call; 8 | import retrofit2.http.Field; 9 | import retrofit2.http.GET; 10 | import retrofit2.http.POST; 11 | 12 | public interface RequestInterface { 13 | 14 | @GET("supermarket_api/v1/get-all-products") 15 | Call getJSON(); 16 | 17 | @GET("supermarket_api/v1/get-all-supermarket-products") 18 | Call getProductsList(); 19 | 20 | @GET("supermarket_api/v1/get-all-users") 21 | Call getUserssList(); 22 | 23 | 24 | } 25 | -------------------------------------------------------------------------------- /app/src/main/res/menu/main.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 9 | 16 | 17 | -------------------------------------------------------------------------------- /app/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # By default, the flags in this file are appended to flags specified 3 | # in D:\softwares\Android\sdk1/tools/proguard/proguard-android.txt 4 | # You can edit the include path and order by changing the proguardFiles 5 | # directive in build.gradle. 6 | # 7 | # For more details, see 8 | # http://developer.android.com/guide/developing/tools/proguard.html 9 | 10 | # Add any project specific keep options here: 11 | 12 | # If your project uses WebView with JS, uncomment the following 13 | # and specify the fully qualified class name to the JavaScript interface 14 | # class: 15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 16 | # public *; 17 | #} 18 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # ![Alt text](screenshots/supermarket.png "Supermarket price comparison app") simple Supermarket price comparison app 2 | 3 | Android and PHP project 4 | 5 | 6 | * This project has a full tutorial here [http://www.kedevelopers.com/android/simple-supermarket-price-comparison-app-part-1/](http://www.kedevelopers.com/android/simple-supermarket-price-comparison-app-part-1/) 7 | 8 | # Project includes 9 | 10 | * Listing all products in DB 11 | * Searching for products 12 | * Adding products 13 | * Adding supermarket users 14 | * Basic CRUD operations 15 | * After installation Admin logins Username: admin@supermarket.com 16 | password: admin1234 17 | 18 | 19 | -------------------------------------------------------------------------------- /app/src/main/res/drawable-v21/ic_menu_share.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /.idea/gradle.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 18 | 19 | -------------------------------------------------------------------------------- /.idea/compiler.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /app/src/main/res/layout/nav_header_main.xml: -------------------------------------------------------------------------------- 1 | 2 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /gradle.properties: -------------------------------------------------------------------------------- 1 | # Project-wide Gradle settings. 2 | 3 | # IDE (e.g. Android Studio) users: 4 | # Gradle settings configured through the IDE *will override* 5 | # any settings specified in this file. 6 | 7 | # For more details on how to configure your build environment visit 8 | # http://www.gradle.org/docs/current/userguide/build_environment.html 9 | 10 | # Specifies the JVM arguments used for the daemon process. 11 | # The setting is particularly useful for tweaking memory settings. 12 | org.gradle.jvmargs=-Xmx2048m 13 | 14 | # When configured, Gradle will run in incubating parallel mode. 15 | # This option should only be used with decoupled projects. More details, visit 16 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects 17 | org.gradle.parallel=true 18 | -------------------------------------------------------------------------------- /app/src/main/java/com/kedevelopers/supermarketprices/Config.java: -------------------------------------------------------------------------------- 1 | package com.kedevelopers.supermarketprices; 2 | 3 | /** 4 | * Created by BEN on 11/17/2016. 5 | */ 6 | 7 | public class Config { 8 | //Data URL 9 | public static final String KE_URL = "http://192.168.137.1"; 10 | public static final String SELLER = "http://192.168.137.1/supermarket_api/v1/get-sellers"; 11 | 12 | 13 | public static final String URL_ADD_USER ="http://192.168.137.1/supermarket_api/v1/register" ; 14 | public static final String URL_SUP_USER ="http://192.168.137.1/supermarket_api/v1/login" ; 15 | public static final String ADD_URL ="http://192.168.137.1/supermarket_api/v1/add-product" ; 16 | public static final String ADD_URL_PRICE ="http://192.168.137.1/supermarket_api/v1/add-product-price" ; 17 | 18 | public static final String DELETE_USER_URL = "http://192.168.137.1/supermarket_api/v1/delete-user"; 19 | } 20 | -------------------------------------------------------------------------------- /app/src/main/res/xml/fab_icon_states.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 0.5 7 | 0 8 | 0.5 9 | 1 10 | 11 | 0 12 | 0.5 13 | 1 14 | 0.5 15 | 16 | 17 | 18 | 19 | 20 | 0.633 21 | 0.161 22 | 0 23 | 0.793 24 | 25 | 0.633 26 | 0.161 27 | 1 28 | 0.527 29 | 30 | 31 | 32 | 0 33 | 1 34 | 35 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /app/src/androidTest/java/com/kedevelopers/supermarketprices/ExampleInstrumentedTest.java: -------------------------------------------------------------------------------- 1 | package com.kedevelopers.supermarketprices; 2 | 3 | import android.content.Context; 4 | import android.support.test.InstrumentationRegistry; 5 | import android.support.test.runner.AndroidJUnit4; 6 | 7 | import org.junit.Test; 8 | import org.junit.runner.RunWith; 9 | 10 | import static org.junit.Assert.*; 11 | 12 | /** 13 | * Instrumentation test, which will execute on an Android device. 14 | * 15 | * @see Testing documentation 16 | */ 17 | @RunWith(AndroidJUnit4.class) 18 | public class ExampleInstrumentedTest { 19 | @Test 20 | public void useAppContext() throws Exception { 21 | // Context of the app under test. 22 | Context appContext = InstrumentationRegistry.getTargetContext(); 23 | 24 | assertEquals("com.kedevelopers.supermarketprices", appContext.getPackageName()); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /app/src/main/java/com/kedevelopers/supermarketprices/JSONResponse.java: -------------------------------------------------------------------------------- 1 | package com.kedevelopers.supermarketprices; 2 | 3 | import com.kedevelopers.supermarketprices.Model.Product; 4 | import com.kedevelopers.supermarketprices.Model.SupermarketProduct; 5 | import com.kedevelopers.supermarketprices.Model.User; 6 | 7 | /** 8 | * Created by BEN on 12/14/2016. 9 | */ 10 | 11 | public class JSONResponse { 12 | private Product[] products; 13 | private SupermarketProduct[] supermarketProducts; 14 | private SupermarketProduct[] supermarketPrices; 15 | private User[] user; 16 | 17 | public Product[] getProducts() { 18 | return products; 19 | } 20 | public User[] getUsers() { 21 | return user; 22 | } 23 | public SupermarketProduct[] getSupermarketProducts() { 24 | return supermarketProducts; 25 | } 26 | public SupermarketProduct[] getSupermarketPrices() { 27 | return supermarketPrices; 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /app/src/main/res/layout/prompt_add_product.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 15 | 16 | 17 | 18 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /app/src/main/res/xml/pref_headers.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 |
9 | 10 |
14 | 15 |
19 | 20 | 21 | -------------------------------------------------------------------------------- /app/src/main/res/xml/pref_data_sync.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | 14 | 15 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /app/src/main/java/com/kedevelopers/supermarketprices/Model/Product.java: -------------------------------------------------------------------------------- 1 | package com.kedevelopers.supermarketprices.Model; 2 | 3 | /** 4 | * Created by BEN on 12/14/2016. 5 | */ 6 | 7 | public class Product { 8 | public String getImage() { 9 | return image; 10 | } 11 | 12 | public String getName() { 13 | return name; 14 | } 15 | public String getDescription() { 16 | return description; 17 | } 18 | 19 | private String image; 20 | 21 | 22 | 23 | private String name; 24 | private String description; 25 | 26 | public String getPrice() { 27 | return price; 28 | } 29 | 30 | private String price; 31 | 32 | public void setName(String name) { 33 | this.name = name; 34 | } 35 | 36 | public void setImage(String image) { 37 | this.image = image; 38 | } 39 | 40 | public void setDescription(String description) { 41 | this.description = description; 42 | } 43 | 44 | public void setPrice(String price) { 45 | this.price = price; 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /app/src/main/java/com/kedevelopers/supermarketprices/Model/SupermarketProduct.java: -------------------------------------------------------------------------------- 1 | package com.kedevelopers.supermarketprices.Model; 2 | 3 | /** 4 | * Created by BEN on 12/22/2016. 5 | */ 6 | 7 | public class SupermarketProduct { 8 | public void setImage(String image) { 9 | this.image = image; 10 | } 11 | 12 | public void setName(String name) { 13 | this.name = name; 14 | } 15 | 16 | public void setDescription(String description) { 17 | this.description = description; 18 | } 19 | 20 | public void setPrice(String price) { 21 | this.price = price; 22 | } 23 | 24 | private String image; 25 | private String name; 26 | private String description; 27 | private String price; 28 | 29 | public String getName() { 30 | return name; 31 | } 32 | 33 | public String getDescription() { 34 | return description; 35 | } 36 | 37 | public String getPrice() { 38 | return price; 39 | } 40 | 41 | public String getImage() { 42 | return image; 43 | } 44 | 45 | 46 | 47 | } 48 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_main.xml: -------------------------------------------------------------------------------- 1 | 2 | 10 | 11 | 15 | 16 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /app/src/main/java/com/kedevelopers/supermarketprices/Model/User.java: -------------------------------------------------------------------------------- 1 | package com.kedevelopers.supermarketprices.Model; 2 | 3 | /** 4 | * Created by BEN on 12/22/2016. 5 | */ 6 | 7 | public class User { 8 | 9 | public String getName() { 10 | return name; 11 | } 12 | 13 | private String id; 14 | 15 | private String name; 16 | private String fname; 17 | private String mname; 18 | private String lname; 19 | private String email; 20 | private String password; 21 | 22 | public String getSupermarket() { 23 | return supermarket; 24 | } 25 | 26 | private String supermarket; 27 | 28 | public String getFname() { 29 | return fname; 30 | } 31 | 32 | public String getId() { 33 | return id; 34 | } 35 | 36 | public String getLname() { 37 | return lname; 38 | } 39 | 40 | public String getMname() { 41 | return mname; 42 | } 43 | 44 | public String getEmail() { 45 | return email; 46 | } 47 | 48 | public String getPassword() { 49 | return password; 50 | } 51 | 52 | 53 | } 54 | -------------------------------------------------------------------------------- /app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 10 | 11 | 15 | 16 | 24 | 25 | 29 | 30 | -------------------------------------------------------------------------------- /app/src/main/res/menu/activity_main_drawer.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 9 | 13 | 17 | 21 | 25 | 26 | 27 | 28 | 29 | 33 | 34 | 35 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /app/src/main/res/layout/content_list_users.xml: -------------------------------------------------------------------------------- 1 | 2 | 15 | 20 | 25 | 26 | -------------------------------------------------------------------------------- /app/src/main/res/layout/content_main.xml: -------------------------------------------------------------------------------- 1 | 2 | 12 | 16 | 17 | 22 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /app/src/main/res/layout/content_supermarket_admin_products.xml: -------------------------------------------------------------------------------- 1 | 2 | 15 | 20 | 25 | 26 | -------------------------------------------------------------------------------- /app/src/main/res/xml/pref_notification.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 9 | 10 | 11 | 12 | 13 | 19 | 20 | 21 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /app/src/main/res/layout/app_bar_main.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 14 | 15 | 21 | 22 | 23 | 24 | 25 | 26 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_list_users.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 14 | 15 | 21 | 22 | 23 | 24 | 25 | 26 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_add_product.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 14 | 15 | 21 | 22 | 23 | 24 | 25 | 26 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /app/src/main/res/xml/pref_general.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 8 | 9 | 10 | 11 | 20 | 21 | 23 | 24 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_admin_add_user.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 14 | 15 | 21 | 22 | 23 | 24 | 25 | 26 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_product_view.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 14 | 15 | 21 | 22 | 23 | 24 | 25 | 26 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_supermarket_admin_products.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 14 | 15 | 21 | 22 | 23 | 24 | 25 | 26 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /app/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.application' 2 | 3 | android { 4 | compileSdkVersion 25 5 | buildToolsVersion "25.0.1" 6 | defaultConfig { 7 | applicationId "com.kedevelopers.supermarketprices" 8 | minSdkVersion 15 9 | targetSdkVersion 25 10 | versionCode 1 11 | versionName "1.0" 12 | testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" 13 | vectorDrawables.useSupportLibrary = true 14 | } 15 | buildTypes { 16 | release { 17 | minifyEnabled false 18 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 19 | } 20 | } 21 | dexOptions { 22 | javaMaxHeapSize "2g" 23 | } 24 | } 25 | 26 | dependencies { 27 | compile fileTree(dir: 'libs', include: ['*.jar']) 28 | androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', { 29 | exclude group: 'com.android.support', module: 'support-annotations' 30 | }) 31 | 32 | 33 | 34 | compile 'com.android.support:appcompat-v7:25.0.0' 35 | compile 'com.android.support:design:25.0.0' 36 | compile 'com.android.support:cardview-v7:25.0.0' 37 | compile 'com.android.support:recyclerview-v7:25.0.0' 38 | compile 'com.rengwuxian.materialedittext:library:2.1.4' 39 | compile 'com.mcxiaoke.volley:library:1.0.19' 40 | compile 'com.github.rey5137:material:1.2.4' 41 | compile 'com.squareup.picasso:picasso:2.5.2' 42 | compile 'com.android.support:support-v4:25.0.0' 43 | compile 'com.android.support:support-vector-drawable:25.0.0' 44 | compile 'com.squareup.retrofit2:retrofit:2.1.0' 45 | compile 'com.squareup.retrofit2:converter-gson:2.1.0' 46 | compile 'com.github.rey5137:material:1.2.4' 47 | testCompile 'junit:junit:4.12' 48 | } 49 | -------------------------------------------------------------------------------- /app/src/main/java/com/kedevelopers/supermarketprices/AppController.java: -------------------------------------------------------------------------------- 1 | package com.kedevelopers.supermarketprices; 2 | 3 | /** 4 | * Created by BEN on 11/17/2016. 5 | */ 6 | 7 | 8 | import android.app.Application; 9 | import android.content.Context; 10 | import android.text.TextUtils; 11 | 12 | import com.android.volley.Request; 13 | import com.android.volley.RequestQueue; 14 | import com.android.volley.toolbox.ImageLoader; 15 | import com.android.volley.toolbox.Volley; 16 | 17 | public class AppController extends Application { 18 | 19 | public static final String TAG = AppController.class 20 | .getSimpleName(); 21 | 22 | private RequestQueue mRequestQueue; 23 | private ImageLoader mImageLoader; 24 | 25 | private static AppController mInstance; 26 | 27 | @Override 28 | public void onCreate() { 29 | super.onCreate(); 30 | mInstance = this; 31 | } 32 | 33 | 34 | @Override 35 | protected void attachBaseContext(Context base) { 36 | super.attachBaseContext(base); 37 | } 38 | public static synchronized AppController getInstance() { 39 | return mInstance; 40 | } 41 | 42 | public RequestQueue getRequestQueue() { 43 | if (mRequestQueue == null) { 44 | mRequestQueue = Volley.newRequestQueue(getApplicationContext()); 45 | } 46 | 47 | return mRequestQueue; 48 | } 49 | 50 | 51 | 52 | public void addToRequestQueue(Request req, String tag) { 53 | // set the default tag if tag is empty 54 | req.setTag(TextUtils.isEmpty(tag) ? TAG : tag); 55 | getRequestQueue().add(req); 56 | } 57 | 58 | public void addToRequestQueue(Request req) { 59 | req.setTag(TAG); 60 | getRequestQueue().add(req); 61 | } 62 | 63 | public void cancelPendingRequests(Object tag) { 64 | if (mRequestQueue != null) { 65 | mRequestQueue.cancelAll(tag); 66 | } 67 | } 68 | } -------------------------------------------------------------------------------- /app/src/main/res/layout/content_product_view.xml: -------------------------------------------------------------------------------- 1 | 2 | 15 | 18 | 22 | 26 | 35 | 43 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | -------------------------------------------------------------------------------- /app/src/main/res/layout/prices_list.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 10 | 11 | 17 | 18 | 19 | 22 | 23 | 24 | 30 | 31 | 37 | 38 | 39 | 40 | 41 | 47 | 48 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | -------------------------------------------------------------------------------- /app/src/main/java/com/kedevelopers/supermarketprices/CustomVolleyRequest.java: -------------------------------------------------------------------------------- 1 | package com.kedevelopers.supermarketprices; 2 | 3 | /** 4 | * Created by BEN on 11/17/2016. 5 | */ 6 | 7 | 8 | import android.content.Context; 9 | import android.graphics.Bitmap; 10 | import android.support.v4.util.LruCache; 11 | 12 | import com.android.volley.Cache; 13 | import com.android.volley.Network; 14 | import com.android.volley.RequestQueue; 15 | import com.android.volley.toolbox.BasicNetwork; 16 | import com.android.volley.toolbox.DiskBasedCache; 17 | import com.android.volley.toolbox.HurlStack; 18 | import com.android.volley.toolbox.ImageLoader; 19 | 20 | 21 | public class CustomVolleyRequest { 22 | 23 | private static CustomVolleyRequest customVolleyRequest; 24 | private static Context context; 25 | private RequestQueue requestQueue; 26 | private ImageLoader imageLoader; 27 | 28 | private CustomVolleyRequest(Context context) { 29 | this.context = context; 30 | this.requestQueue = getRequestQueue(); 31 | 32 | imageLoader = new ImageLoader(requestQueue, 33 | new ImageLoader.ImageCache() { 34 | private final LruCache 35 | cache = new LruCache(20); 36 | 37 | @Override 38 | public Bitmap getBitmap(String url) { 39 | return cache.get(url); 40 | } 41 | 42 | @Override 43 | public void putBitmap(String url, Bitmap bitmap) { 44 | cache.put(url, bitmap); 45 | } 46 | }); 47 | } 48 | 49 | public static synchronized CustomVolleyRequest getInstance(Context context) { 50 | if (customVolleyRequest == null) { 51 | customVolleyRequest = new CustomVolleyRequest(context); 52 | } 53 | return customVolleyRequest; 54 | } 55 | 56 | public RequestQueue getRequestQueue() { 57 | if (requestQueue == null) { 58 | Cache cache = new DiskBasedCache(context.getCacheDir(), 10 * 1024 * 1024); 59 | Network network = new BasicNetwork(new HurlStack()); 60 | requestQueue = new RequestQueue(cache, network); 61 | requestQueue.start(); 62 | } 63 | return requestQueue; 64 | } 65 | 66 | public ImageLoader getImageLoader() { 67 | return imageLoader; 68 | } 69 | } -------------------------------------------------------------------------------- /app/src/main/res/layout/seller_list.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 10 | 11 | 16 | 17 | 21 | 22 | 25 | 26 | 27 | 33 | 34 | 40 | 41 | 42 | 43 | 44 | 50 | 51 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | -------------------------------------------------------------------------------- /gradlew.bat: -------------------------------------------------------------------------------- 1 | @if "%DEBUG%" == "" @echo off 2 | @rem ########################################################################## 3 | @rem 4 | @rem Gradle startup script for Windows 5 | @rem 6 | @rem ########################################################################## 7 | 8 | @rem Set local scope for the variables with windows NT shell 9 | if "%OS%"=="Windows_NT" setlocal 10 | 11 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 12 | set DEFAULT_JVM_OPTS= 13 | 14 | set DIRNAME=%~dp0 15 | if "%DIRNAME%" == "" set DIRNAME=. 16 | set APP_BASE_NAME=%~n0 17 | set APP_HOME=%DIRNAME% 18 | 19 | @rem Find java.exe 20 | if defined JAVA_HOME goto findJavaFromJavaHome 21 | 22 | set JAVA_EXE=java.exe 23 | %JAVA_EXE% -version >NUL 2>&1 24 | if "%ERRORLEVEL%" == "0" goto init 25 | 26 | echo. 27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 28 | echo. 29 | echo Please set the JAVA_HOME variable in your environment to match the 30 | echo location of your Java installation. 31 | 32 | goto fail 33 | 34 | :findJavaFromJavaHome 35 | set JAVA_HOME=%JAVA_HOME:"=% 36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 37 | 38 | if exist "%JAVA_EXE%" goto init 39 | 40 | echo. 41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 42 | echo. 43 | echo Please set the JAVA_HOME variable in your environment to match the 44 | echo location of your Java installation. 45 | 46 | goto fail 47 | 48 | :init 49 | @rem Get command-line arguments, handling Windowz variants 50 | 51 | if not "%OS%" == "Windows_NT" goto win9xME_args 52 | if "%@eval[2+2]" == "4" goto 4NT_args 53 | 54 | :win9xME_args 55 | @rem Slurp the command line arguments. 56 | set CMD_LINE_ARGS= 57 | set _SKIP=2 58 | 59 | :win9xME_args_slurp 60 | if "x%~1" == "x" goto execute 61 | 62 | set CMD_LINE_ARGS=%* 63 | goto execute 64 | 65 | :4NT_args 66 | @rem Get arguments from the 4NT Shell from JP Software 67 | set CMD_LINE_ARGS=%$ 68 | 69 | :execute 70 | @rem Setup the command line 71 | 72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 73 | 74 | @rem Execute Gradle 75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% 76 | 77 | :end 78 | @rem End local scope for the variables with windows NT shell 79 | if "%ERRORLEVEL%"=="0" goto mainEnd 80 | 81 | :fail 82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 83 | rem the _cmd.exe /c_ return code! 84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 85 | exit /b 1 86 | 87 | :mainEnd 88 | if "%OS%"=="Windows_NT" endlocal 89 | 90 | :omega 91 | -------------------------------------------------------------------------------- /.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 19 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 46 | 47 | 48 | 49 | 50 | 1.8 51 | 52 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 68 | 69 | 70 | 71 | 72 | 73 | -------------------------------------------------------------------------------- /app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 19 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 34 | 37 | 38 | 41 | 44 | 48 | 51 | 55 | 58 | 59 | 63 | 67 | 68 | 69 | -------------------------------------------------------------------------------- /app/src/main/res/layout/products_list.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 10 | 11 | 17 | 18 | 23 | 24 | 27 | 28 | 29 | 35 | 36 | 42 | 43 | 44 | 45 | 46 | 52 | 53 | 59 | 60 | 61 | 62 | 68 | 69 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_login.xml: -------------------------------------------------------------------------------- 1 | 12 | 13 | 14 | 21 | 22 | 26 | 27 | 32 | 33 | 36 | 37 | 45 | 46 | 47 | 48 | 51 | 52 | 63 | 64 | 65 | 66 |