diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..c6cbe56
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,8 @@
+*.iml
+.gradle
+/local.properties
+/.idea/workspace.xml
+/.idea/libraries
+.DS_Store
+/build
+/captures
diff --git a/.idea/.name b/.idea/.name
new file mode 100644
index 0000000..825246d
--- /dev/null
+++ b/.idea/.name
@@ -0,0 +1 @@
+mi-dev-test
\ No newline at end of file
diff --git a/.idea/compiler.xml b/.idea/compiler.xml
new file mode 100644
index 0000000..96cc43e
--- /dev/null
+++ b/.idea/compiler.xml
@@ -0,0 +1,22 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/copyright/profiles_settings.xml b/.idea/copyright/profiles_settings.xml
new file mode 100644
index 0000000..e7bedf3
--- /dev/null
+++ b/.idea/copyright/profiles_settings.xml
@@ -0,0 +1,3 @@
+
+
+
\ No newline at end of file
diff --git a/.idea/modules.xml b/.idea/modules.xml
new file mode 100644
index 0000000..7c671b1
--- /dev/null
+++ b/.idea/modules.xml
@@ -0,0 +1,9 @@
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/vcs.xml b/.idea/vcs.xml
new file mode 100644
index 0000000..6564d52
--- /dev/null
+++ b/.idea/vcs.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/.gitignore b/app/.gitignore
new file mode 100644
index 0000000..796b96d
--- /dev/null
+++ b/app/.gitignore
@@ -0,0 +1 @@
+/build
diff --git a/app/build.gradle b/app/build.gradle
new file mode 100644
index 0000000..473fd5d
--- /dev/null
+++ b/app/build.gradle
@@ -0,0 +1,32 @@
+apply plugin: 'com.android.application'
+
+android {
+ compileSdkVersion 23
+ buildToolsVersion "23.0.2"
+
+ defaultConfig {
+ applicationId "com.infinity.massive"
+ minSdkVersion 15
+ targetSdkVersion 23
+ versionCode 1
+ versionName "1.0"
+ }
+ buildTypes {
+ release {
+ minifyEnabled false
+ proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
+ }
+ }
+}
+
+dependencies {
+ compile fileTree(dir: 'libs', include: ['*.jar'])
+ testCompile 'junit:junit:4.12'
+ compile 'com.android.support:appcompat-v7:23.1.1'
+ compile 'com.android.support:design:23.1.1'
+ compile 'com.android.support:cardview-v7:23.0.0'
+ compile 'com.squareup.retrofit:retrofit:2.0.0-beta2'
+ compile 'com.squareup.retrofit:converter-gson:2.0.0-beta2'
+ compile 'de.hdodenhof:circleimageview:1.3.0'
+ compile 'com.squareup.picasso:picasso:2.5.2'
+}
diff --git a/app/libs/gson-2.3.1.jar b/app/libs/gson-2.3.1.jar
new file mode 100644
index 0000000..250132c
Binary files /dev/null and b/app/libs/gson-2.3.1.jar differ
diff --git a/app/proguard-rules.pro b/app/proguard-rules.pro
new file mode 100644
index 0000000..191fe35
--- /dev/null
+++ b/app/proguard-rules.pro
@@ -0,0 +1,17 @@
+# Add project specific ProGuard rules here.
+# By default, the flags in this file are appended to flags specified
+# in /Users/ilandrayan/android-sdks/tools/proguard/proguard-android.txt
+# You can edit the include path and order by changing the proguardFiles
+# directive in build.gradle.
+#
+# For more details, see
+# http://developer.android.com/guide/developing/tools/proguard.html
+
+# Add any project specific keep options here:
+
+# 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 *;
+#}
diff --git a/app/src/androidTest/java/com/infinity/massive/ApplicationTest.java b/app/src/androidTest/java/com/infinity/massive/ApplicationTest.java
new file mode 100644
index 0000000..dc4c850
--- /dev/null
+++ b/app/src/androidTest/java/com/infinity/massive/ApplicationTest.java
@@ -0,0 +1,13 @@
+package com.infinity.massive;
+
+import android.app.Application;
+import android.test.ApplicationTestCase;
+
+/**
+ * Testing Fundamentals
+ */
+public class ApplicationTest extends ApplicationTestCase {
+ public ApplicationTest() {
+ super(Application.class);
+ }
+}
\ No newline at end of file
diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml
new file mode 100644
index 0000000..e100bee
--- /dev/null
+++ b/app/src/main/AndroidManifest.xml
@@ -0,0 +1,35 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/src/main/java/com/infinity/massive/ApplicationMassiveInfinity.java b/app/src/main/java/com/infinity/massive/ApplicationMassiveInfinity.java
new file mode 100644
index 0000000..107b26d
--- /dev/null
+++ b/app/src/main/java/com/infinity/massive/ApplicationMassiveInfinity.java
@@ -0,0 +1,48 @@
+package com.infinity.massive;
+
+import android.app.Activity;
+import android.app.Application;
+import android.content.Context;
+import android.support.v4.content.LocalBroadcastManager;
+import android.util.Log;
+
+/**
+ * Created by Ilanthirayan on 25/1/16.
+ */
+public class ApplicationMassiveInfinity extends Application {
+
+ private static final String TAG = ApplicationMassiveInfinity.class.getSimpleName();
+
+ private static LocalBroadcastManager sLbm;
+
+ protected static Context sContext;
+ protected static Activity sActivity;
+
+
+ @Override
+ public void onCreate() {
+
+ super.onCreate();
+ Log.i(TAG, "onCreate: Called");
+ sContext = getApplicationContext();
+
+ sLbm = LocalBroadcastManager.getInstance(sContext);
+
+ }
+
+ public static LocalBroadcastManager getLbm(){
+ return sLbm;
+ }
+
+ protected static void setCurrentActivity(Activity currentActivity) {
+ sActivity = currentActivity;
+ }
+
+ public static Context getContext() {
+ return sContext;
+ }
+
+ protected static Activity getCurrentActivity() {
+ return sActivity;
+ }
+}
diff --git a/app/src/main/java/com/infinity/massive/controller/AndroidVersionController.java b/app/src/main/java/com/infinity/massive/controller/AndroidVersionController.java
new file mode 100644
index 0000000..aeec2a4
--- /dev/null
+++ b/app/src/main/java/com/infinity/massive/controller/AndroidVersionController.java
@@ -0,0 +1,39 @@
+package com.infinity.massive.controller;
+
+import com.infinity.massive.ApplicationMassiveInfinity;
+import com.infinity.massive.R;
+import com.infinity.massive.model.api.AndroidVersionInfoService;
+import com.infinity.massive.model.pojo.Android;
+
+import java.util.List;
+
+import retrofit.Call;
+import retrofit.GsonConverterFactory;
+import retrofit.Retrofit;
+
+/**
+ * Created by Ilanthirayan on 26/1/16.
+ */
+public class AndroidVersionController {
+
+ private static final String TAG = DeviceController.class.getSimpleName();
+
+ private Retrofit retrofit;
+ private AndroidVersionInfoService androidVersionInfoService;
+
+ public AndroidVersionController() {
+ retrofit = new Retrofit.Builder()
+ .baseUrl(ApplicationMassiveInfinity.getContext().getResources().getString(R.string.massive_infinity_api_url))
+ .addConverterFactory(GsonConverterFactory.create())
+ .build();
+
+ androidVersionInfoService = retrofit.create(AndroidVersionInfoService.class);
+ }
+
+ public Call getProductDetailsService(int device_id){
+ Call response = androidVersionInfoService.getAndroidVersionDetails(device_id
+ );
+
+ return response;
+ }
+}
diff --git a/app/src/main/java/com/infinity/massive/controller/DeviceController.java b/app/src/main/java/com/infinity/massive/controller/DeviceController.java
new file mode 100644
index 0000000..72ae3d4
--- /dev/null
+++ b/app/src/main/java/com/infinity/massive/controller/DeviceController.java
@@ -0,0 +1,39 @@
+package com.infinity.massive.controller;
+
+import com.infinity.massive.ApplicationMassiveInfinity;
+import com.infinity.massive.R;
+import com.infinity.massive.model.api.DeviceInfoService;
+import com.infinity.massive.model.pojo.Devices;
+
+import java.util.List;
+
+import retrofit.Call;
+import retrofit.GsonConverterFactory;
+import retrofit.Retrofit;
+
+/**
+ * Created by Ilanthirayan on 25/1/16.
+ */
+public class DeviceController {
+
+ private static final String TAG = DeviceController.class.getSimpleName();
+
+ private Retrofit retrofit;
+ private DeviceInfoService deviceInfoService;
+
+ public DeviceController() {
+ retrofit = new Retrofit.Builder()
+ .baseUrl(ApplicationMassiveInfinity.getContext().getResources().getString(R.string.massive_infinity_api_url))
+ .addConverterFactory(GsonConverterFactory.create())
+ .build();
+
+ deviceInfoService = retrofit.create(DeviceInfoService.class);
+ }
+
+ public Call> getProductDetailsService(){
+ Call> response = deviceInfoService.getDevices(
+ );
+
+ return response;
+ }
+}
diff --git a/app/src/main/java/com/infinity/massive/controller/service/DeviceDownloadService.java b/app/src/main/java/com/infinity/massive/controller/service/DeviceDownloadService.java
new file mode 100644
index 0000000..efc60ad
--- /dev/null
+++ b/app/src/main/java/com/infinity/massive/controller/service/DeviceDownloadService.java
@@ -0,0 +1,142 @@
+package com.infinity.massive.controller.service;
+
+import android.app.ActivityManager;
+import android.app.Service;
+import android.content.Context;
+import android.content.Intent;
+import android.os.Bundle;
+import android.os.IBinder;
+import android.support.annotation.Nullable;
+import android.util.Log;
+
+import com.infinity.massive.ApplicationMassiveInfinity;
+import com.infinity.massive.controller.DeviceController;
+import com.infinity.massive.model.pojo.Devices;
+import com.infinity.massive.utils.DataBaseClient;
+
+import java.util.List;
+import java.util.concurrent.atomic.AtomicInteger;
+
+import retrofit.Call;
+import retrofit.Callback;
+import retrofit.Response;
+import retrofit.Retrofit;
+
+/**
+ * Created by Ilanthirayan on 25/1/16.
+ */
+public class DeviceDownloadService extends Service{
+
+ public static final String ACTION_BLOCK_RENDER_DEVICE_DOWNLOAD_FINISHED = DeviceDownloadService.class.getName()
+ + ".action.BLOCK_RENDER_DEVICE_DOWNLOAD_FINISHED";
+
+ /**
+ * String {@link #ACTION_BLOCK_RENDER_DEVICE_DOWNLOAD_FINISHED} intent extra:
+ * the full name of the service class that downloaded
+ */
+ public static final String EXTRA_SERVICE_NAME = "service_name";
+
+ public static final String EXTRA_REMAINING_BLOCK_RENDER_DEVICE_LIST = "remaining_block_render_device_list";
+
+ static final String TAG = DeviceDownloadService.class.getSimpleName();
+
+ static final AtomicInteger blockRenderDeviceListLayoutLeft = new AtomicInteger(0);
+
+
+ @Override
+ public int onStartCommand(Intent intent, int flags, int startId) {
+
+ final int res = START_STICKY;
+
+ if(intent == null) {
+ Log.d(TAG, "Inside " + TAG + " intent is @null");
+ return res;
+ }else{
+ Log.d(TAG, "Inside " + TAG + " intent is NOT @null");
+ }
+ blockRenderDeviceListLayoutLeft.incrementAndGet();
+
+ startDownload();
+
+
+ return res;
+ }
+
+
+ protected void startDownload(){
+ DeviceController mDeviceController = new DeviceController();
+ Call> response = mDeviceController.getProductDetailsService();
+ response.enqueue(new Callback>() {
+ @Override
+ public void onResponse(Response> response, Retrofit retrofit) {
+ Log.d(TAG, "Response Raw :: " + response.raw());
+ if (response.body().size() > 0) {
+ //SUCCESSFULLY PRODUCTS RECEIVE
+
+ //SAVE THE PRODUCTS IN TO THE DATABASE
+ DataBaseClient.getInstance().insertDevices(response.body(), true);
+
+ //SEND THE BROADCAST TO NOTIFY DOWNLOAD COMPLETED
+ final Intent buzzIntent = new Intent(ACTION_BLOCK_RENDER_DEVICE_DOWNLOAD_FINISHED)
+ .putExtra(EXTRA_SERVICE_NAME, getClass().getName())
+ .putExtra(EXTRA_REMAINING_BLOCK_RENDER_DEVICE_LIST, blockRenderDeviceListLayoutLeft.decrementAndGet());
+ ApplicationMassiveInfinity.getLbm().sendBroadcast(buzzIntent);
+
+ } else {
+ //ERROR MESSAGE DIALOG
+ }
+
+ Log.d(TAG, "@@blockRenderBuzzFeedsLayoutLeft :: " + blockRenderDeviceListLayoutLeft.get());
+ stopSelf();
+ }
+
+ @Override
+ public void onFailure(Throwable e) {
+ Log.d(TAG, "onFailure: " + e.getMessage());
+ stopSelf();
+ }
+ });
+ }
+
+
+ public static int getRemainingBlockRenderProductLayoutDownloads(){
+ return blockRenderDeviceListLayoutLeft.get();
+ }
+
+
+ /**
+ * Start a download service, if it is not disabled in the config.
+ * The config.xml values contains a string value named 'disabled_download_service_simple_names'
+ * Add the simple name of the download service class to that string, separated by whitespace in order
+ * for that service not to be started.
+ *
+ * @param startWhenAlreadyRunning force start even if the service is already running
+ * @param extras extras to start service intent
+ */
+ public static void start( final boolean startWhenAlreadyRunning, final Bundle extras) {
+ final Context mContext = ApplicationMassiveInfinity.getContext();
+ if (!startWhenAlreadyRunning) {
+ final ActivityManager manager = (ActivityManager) mContext.getSystemService(Context.ACTIVITY_SERVICE);
+ for (ActivityManager.RunningServiceInfo serviceInfo : manager.getRunningServices(Integer.MAX_VALUE)) {
+ if (DeviceDownloadService.class.getName().equals(serviceInfo.service.getClassName())) {
+ Log.d(TAG, DeviceDownloadService.class.getSimpleName() + " not started because it is already running");
+ return;
+ }
+ }
+ }
+
+ Log.d(TAG, DeviceDownloadService.class.getSimpleName() + " starting");
+ final Intent intent = new Intent(mContext, DeviceDownloadService.class);
+ if (extras != null) {
+ intent.replaceExtras(extras);
+ }
+ mContext.startService(intent);
+ }
+
+ @Nullable
+ @Override
+ public IBinder onBind(Intent intent) {
+ return null;
+ }
+
+}
diff --git a/app/src/main/java/com/infinity/massive/model/adapter/DeviceListViewAdapter.java b/app/src/main/java/com/infinity/massive/model/adapter/DeviceListViewAdapter.java
new file mode 100644
index 0000000..b1b38c0
--- /dev/null
+++ b/app/src/main/java/com/infinity/massive/model/adapter/DeviceListViewAdapter.java
@@ -0,0 +1,123 @@
+package com.infinity.massive.model.adapter;
+
+import android.app.Activity;
+import android.content.Intent;
+import android.support.v7.widget.CardView;
+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.ProgressBar;
+import android.widget.TextView;
+
+import com.infinity.massive.ApplicationMassiveInfinity;
+import com.infinity.massive.R;
+import com.infinity.massive.model.pojo.Devices;
+import com.infinity.massive.view.activity.AndroidVersionDetailsActivity;
+import com.squareup.picasso.Picasso;
+
+import java.util.List;
+
+/**
+ * Created by Ilanthirayan on 25/1/16.
+ */
+public class DeviceListViewAdapter extends RecyclerView.Adapter{
+
+ private static final String TAG = DeviceListViewAdapter.class.getSimpleName();
+
+ private Activity mActivity;
+ private List devicesList;
+
+ private final int VIEW_ITEM = 1;
+ private final int VIEW_PROG = 0;
+
+ public DeviceListViewAdapter(Activity mActivity, List devicesList) {
+ this.mActivity = mActivity;
+ this.devicesList = devicesList;
+ }
+
+ @Override
+ public int getItemCount() {
+ return devicesList.size();
+ }
+
+ @Override
+ public int getItemViewType(int position) {
+ return devicesList.get(position) != null ? VIEW_ITEM : VIEW_PROG;
+ }
+
+ public static class ProgressViewHolder extends RecyclerView.ViewHolder {
+ public ProgressBar progressBar;
+ public ProgressViewHolder(View v) {
+ super(v);
+ progressBar = (ProgressBar)v.findViewById(R.id.progressBar);
+ }
+ }
+
+ @Override
+ public RecyclerView.ViewHolder onCreateViewHolder(ViewGroup viewGroup, int position) {
+ RecyclerView.ViewHolder viewHolder;
+ if(position==VIEW_ITEM) {
+ View view = LayoutInflater.from(viewGroup.getContext()).inflate(R.layout.adapter_item_device_view, viewGroup, false);
+ viewHolder = new DeviceViewHolder(viewGroup, view);
+ }else{
+ View view = LayoutInflater.from(viewGroup.getContext()) .inflate(R.layout.progress_item, viewGroup, false);
+ viewHolder = new ProgressViewHolder(view);
+ }
+
+ return viewHolder;
+ }
+
+ @Override
+ public void onBindViewHolder(RecyclerView.ViewHolder holder, int position) {
+ if(holder instanceof ProgressViewHolder){
+ ((ProgressViewHolder)holder).progressBar.setIndeterminate(true);
+ }else {
+ final Devices item = devicesList.get(position);
+ ((DeviceViewHolder) holder).nameTxt.setText(item.getName());
+ ((DeviceViewHolder) holder).snippetTxt.setText(item.getSnippet());
+ ((DeviceViewHolder) holder).androidIdTxt.setText(String.valueOf(item.getAndroidId()));
+
+ //Get the product image
+ if(item.getImageUrl() != null) {
+ Picasso.with(mActivity).load(item.getImageUrl()).into(((DeviceViewHolder) holder).deviceImg);
+ }
+
+ ((DeviceViewHolder) holder).deviceCardView.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ //START THE PRODUCT DETAILS ACTIVITY
+ Intent intent = new Intent(ApplicationMassiveInfinity.getContext(), AndroidVersionDetailsActivity.class);
+ intent.putExtra(AndroidVersionDetailsActivity.EXTRAS_MASSIVE_INFINITY_DEVICE_ID, item.getId());
+ mActivity.startActivity(intent);
+ }
+ });
+ }
+ }
+
+ public class DeviceViewHolder extends RecyclerView.ViewHolder implements View.OnClickListener {
+ ImageView deviceImg;
+ TextView snippetTxt;
+ TextView androidIdTxt;
+ TextView nameTxt;
+ ViewGroup viewGroup;
+ CardView deviceCardView;
+
+ public DeviceViewHolder(ViewGroup viewGroup, View itemView) {
+ super(itemView);
+ this.viewGroup = viewGroup;
+ deviceCardView = (CardView) itemView.findViewById(R.id.device_card_layout);
+ deviceImg = (ImageView) itemView.findViewById(R.id.device_image);
+ nameTxt = (TextView) itemView.findViewById(R.id.device_name_txt);
+ androidIdTxt = (TextView) itemView.findViewById(R.id.device_android_id_txt);
+ snippetTxt = (TextView) itemView.findViewById(R.id.device_snippet_txt);
+ }
+
+ @Override
+ public void onClick(final View view){
+ //TODO
+ }
+ }
+
+}
diff --git a/app/src/main/java/com/infinity/massive/model/api/AndroidVersionInfoService.java b/app/src/main/java/com/infinity/massive/model/api/AndroidVersionInfoService.java
new file mode 100644
index 0000000..19d5221
--- /dev/null
+++ b/app/src/main/java/com/infinity/massive/model/api/AndroidVersionInfoService.java
@@ -0,0 +1,23 @@
+package com.infinity.massive.model.api;
+
+import com.infinity.massive.model.pojo.Android;
+
+import java.util.List;
+
+import retrofit.Call;
+import retrofit.http.GET;
+import retrofit.http.Path;
+
+/**
+ * Created by Ilanthirayan on 26/1/16.
+ */
+public interface AndroidVersionInfoService {
+
+ @GET("android")
+ Call> getAndroidVersions();
+
+ @GET("android/{device_id}")
+ Call getAndroidVersionDetails(
+ @Path("device_id") int device_id
+ );
+}
diff --git a/app/src/main/java/com/infinity/massive/model/api/DeviceInfoService.java b/app/src/main/java/com/infinity/massive/model/api/DeviceInfoService.java
new file mode 100644
index 0000000..e286ab8
--- /dev/null
+++ b/app/src/main/java/com/infinity/massive/model/api/DeviceInfoService.java
@@ -0,0 +1,23 @@
+package com.infinity.massive.model.api;
+
+import com.infinity.massive.model.pojo.Devices;
+
+import java.util.List;
+
+import retrofit.Call;
+import retrofit.http.GET;
+import retrofit.http.Path;
+
+/**
+ * Created by Ilanthirayan on 26/1/16.
+ */
+public interface DeviceInfoService {
+
+ @GET("devices")
+ Call> getDevices();
+
+ @GET("devices/{device_id}")
+ Call getDeviceDetails(
+ @Path("device_id") int device_id
+ );
+}
diff --git a/app/src/main/java/com/infinity/massive/model/pojo/Android.java b/app/src/main/java/com/infinity/massive/model/pojo/Android.java
new file mode 100644
index 0000000..b8db3d3
--- /dev/null
+++ b/app/src/main/java/com/infinity/massive/model/pojo/Android.java
@@ -0,0 +1,67 @@
+package com.infinity.massive.model.pojo;
+
+/**
+ * Created by Ilanthirayan on 25/1/16.
+ */
+public class Android {
+
+ private String id;
+ private String codename;
+ private String name;
+ private String target;
+ private String distribution;
+ private String version;
+
+ public String getId() {
+ return id;
+ }
+
+ public void setId(String id) {
+ this.id = id;
+ }
+
+ public String getCodename() {
+ return codename;
+ }
+
+ public void setCodename(String codename) {
+ this.codename = codename;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public String getTarget() {
+ return target;
+ }
+
+ public void setTarget(String target) {
+ this.target = target;
+ }
+
+ public String getDistribution() {
+ return distribution;
+ }
+
+ public void setDistribution(String distribution) {
+ this.distribution = distribution;
+ }
+
+ public String getVersion() {
+ return version;
+ }
+
+ public void setVersion(String version) {
+ this.version = version;
+ }
+
+ @Override
+ public String toString() {
+ return "ClassPojo [id = " + id + ", codename = " + codename + ", name = " + name + ", target = " + target + ", distribution = " + distribution + ", version = " + version + "]";
+ }
+}
diff --git a/app/src/main/java/com/infinity/massive/model/pojo/Devices.java b/app/src/main/java/com/infinity/massive/model/pojo/Devices.java
new file mode 100644
index 0000000..a506961
--- /dev/null
+++ b/app/src/main/java/com/infinity/massive/model/pojo/Devices.java
@@ -0,0 +1,106 @@
+package com.infinity.massive.model.pojo;
+
+import android.content.ContentValues;
+import android.database.Cursor;
+import android.provider.BaseColumns;
+
+/**
+ * Created by Ilanthirayan on 25/1/16.
+ */
+public class Devices {
+
+ public static final String TABLE_NAME = "tbl_device";
+
+ private int id;
+ private String imageUrl;
+ private String name;
+ private int androidId;
+ private String snippet;
+
+ public Devices(){}
+
+ public interface Columns extends BaseColumns {
+ String DEVICE_ID = "id";
+ String IMAGE_URL = "image_url";
+ String NAME = "name";
+ String ANDROID_ID = "androidId";
+ String SNIPPET = "snippet";
+ }
+
+ public Devices(Cursor cursor){
+ fromCursor(cursor);
+ }
+
+ private void fromCursor(Cursor cursor) {
+ int i = cursor.getColumnIndexOrThrow(Columns.DEVICE_ID);
+ setId(cursor.getInt(i));
+
+ i = cursor.getColumnIndexOrThrow(Columns.IMAGE_URL);
+ setImageUrl(cursor.getString(i));
+
+ i = cursor.getColumnIndexOrThrow(Columns.NAME);
+ setName(cursor.getString(i));
+
+ i = cursor.getColumnIndexOrThrow(Columns.ANDROID_ID);
+ setAndroidId(cursor.getInt(i));
+
+ i = cursor.getColumnIndexOrThrow(Columns.SNIPPET);
+ setSnippet(cursor.getString(i));
+
+ }
+
+ public ContentValues toContentValues() {
+ final ContentValues values = new ContentValues();
+ values.put(Columns.DEVICE_ID, getId());
+ values.put(Columns.IMAGE_URL, getImageUrl());
+ values.put(Columns.NAME, getName());
+ values.put(Columns.ANDROID_ID, getAndroidId());
+ values.put(Columns.SNIPPET, getSnippet());
+ return values;
+ }
+
+ public int getId() {
+ return id;
+ }
+
+ public void setId(int id) {
+ this.id = id;
+ }
+
+ public String getImageUrl() {
+ return imageUrl;
+ }
+
+ public void setImageUrl(String imageUrl) {
+ this.imageUrl = imageUrl;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public int getAndroidId() {
+ return androidId;
+ }
+
+ public void setAndroidId(int androidId) {
+ this.androidId = androidId;
+ }
+
+ public String getSnippet() {
+ return snippet;
+ }
+
+ public void setSnippet(String snippet) {
+ this.snippet = snippet;
+ }
+
+ @Override
+ public String toString() {
+ return "ClassPojo [id = " + id + ", imageUrl = " + imageUrl + ", name = " + name + ", androidId = " + androidId + ", snippet = " + snippet + "]";
+ }
+}
diff --git a/app/src/main/java/com/infinity/massive/model/pojo/ParentResponse.java b/app/src/main/java/com/infinity/massive/model/pojo/ParentResponse.java
new file mode 100644
index 0000000..664a9e0
--- /dev/null
+++ b/app/src/main/java/com/infinity/massive/model/pojo/ParentResponse.java
@@ -0,0 +1,34 @@
+package com.infinity.massive.model.pojo;
+
+import com.infinity.massive.model.pojo.Android;
+import com.infinity.massive.model.pojo.Devices;
+
+/**
+ * Created by Ilanthirayan on 25/1/16.
+ */
+public class ParentResponse {
+
+ private Android[] android;
+ private Devices[] devices;
+
+ public Android[] getAndroid() {
+ return android;
+ }
+
+ public void setAndroid(Android[] android) {
+ this.android = android;
+ }
+
+ public Devices[] getDevices() {
+ return devices;
+ }
+
+ public void setDevices(Devices[] devices) {
+ this.devices = devices;
+ }
+
+ @Override
+ public String toString() {
+ return "ClassPojo [android = " + android + ", devices = " + devices + "]";
+ }
+}
diff --git a/app/src/main/java/com/infinity/massive/utils/DBHelper.java b/app/src/main/java/com/infinity/massive/utils/DBHelper.java
new file mode 100644
index 0000000..a8efe52
--- /dev/null
+++ b/app/src/main/java/com/infinity/massive/utils/DBHelper.java
@@ -0,0 +1,63 @@
+package com.infinity.massive.utils;
+
+import android.database.sqlite.SQLiteDatabase;
+import android.database.sqlite.SQLiteOpenHelper;
+import android.util.Log;
+
+import com.infinity.massive.ApplicationMassiveInfinity;
+import com.infinity.massive.model.pojo.Devices;
+
+/**
+ * Created by Ilanthirayan on 25/1/16.
+ */
+public class DBHelper extends SQLiteOpenHelper {
+
+ private static final String DB_NAME = "redmart_container.db";
+ private static final int DB_VERSION = 1;
+ private static final String TAG = DBHelper.class.getSimpleName();
+ private static final String CREATE_INDEX = "CREATE INDEX IF NOT EXISTS ";
+
+ enum INSTANCE {
+ INSTANCE;
+ final DBHelper instance = new DBHelper();
+ }
+
+ private DBHelper() {
+ super(ApplicationMassiveInfinity.getContext(), DB_NAME, null, DB_VERSION);
+ }
+
+ public static DBHelper getInstance() {
+ return INSTANCE.INSTANCE.instance;
+ }
+
+ private static final String CREATE_TABLE_DEVICE = "CREATE TABLE "
+ + Devices.TABLE_NAME + " ("
+ + Devices.Columns._ID + " INTEGER PRIMARY KEY AUTOINCREMENT,"
+ + Devices.Columns.DEVICE_ID + " INTEGER, "
+ + Devices.Columns.IMAGE_URL + " TEXT, "
+ + Devices.Columns.NAME + " TEXT, "
+ + Devices.Columns.ANDROID_ID + " TEXT, "
+ + Devices.Columns.SNIPPET + " TEXT); ";
+
+ private static final String CREATE_DEVICE_INDEX_ID = CREATE_INDEX
+ + " index_based_id ON "
+ + Devices.TABLE_NAME + "("
+ + Devices.Columns.DEVICE_ID + ");";
+
+ @Override
+ public void onCreate(SQLiteDatabase db) {
+ Log.d(TAG, "db onCreate");
+ //CREATE TABLES
+ db.execSQL(CREATE_TABLE_DEVICE);
+
+ //CREATE INDICES
+ db.execSQL(CREATE_DEVICE_INDEX_ID);
+
+ }
+
+ @Override
+ public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
+ Log.d(TAG, "db onUpgrade");
+ //UPGRADE
+ }
+}
diff --git a/app/src/main/java/com/infinity/massive/utils/DataBaseClient.java b/app/src/main/java/com/infinity/massive/utils/DataBaseClient.java
new file mode 100644
index 0000000..6221e01
--- /dev/null
+++ b/app/src/main/java/com/infinity/massive/utils/DataBaseClient.java
@@ -0,0 +1,98 @@
+package com.infinity.massive.utils;
+
+import android.database.Cursor;
+import android.database.DatabaseUtils;
+import android.database.sqlite.SQLiteDatabase;
+import android.util.Log;
+
+import com.infinity.massive.model.pojo.Devices;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * Created by Ilanthirayan on 25/1/16.
+ */
+public class DataBaseClient {
+
+ private static final String TAG = DataBaseClient.class.getSimpleName();
+
+ enum INSTANCE {
+ INSTANCE;
+ public final DataBaseClient instance = new DataBaseClient();
+ }
+
+ public static DataBaseClient getInstance() {
+ return INSTANCE.INSTANCE.instance;
+ }
+
+ private DataBaseClient() {}
+
+ public synchronized void insertDevices(final List devicesList, boolean fromService){
+ final SQLiteDatabase db = DBHelper.getInstance().getWritableDatabase();
+ try{
+ db.beginTransaction();
+ //FROM SERVICE DOWNLOAD IS FIRST SET OF DEVICES SO CLEAR THE TABLE
+ if(fromService){
+ //clear the table before insert in to the table
+ db.delete(Devices.TABLE_NAME, null, null);
+ }
+ for(Devices devices : devicesList){
+ //INSERT INTO tbl_product
+ boolean successProduct = db.insert(Devices.TABLE_NAME, null, devices.toContentValues()) > 0 ;
+ if(successProduct){
+ Log.d(TAG, "Successfully inserted in to Devices.TABLE_NAME.");
+ }else{
+ Log.d(TAG, "Not inserted in to Devices.TABLE_NAME.");
+ }
+ }
+ db.setTransactionSuccessful();
+ }catch(Exception e){
+ e.printStackTrace();
+ }finally {
+ db.endTransaction();
+ db.close();
+ }
+ }
+
+
+ public synchronized List getDevices(){
+ List devicesList = new ArrayList<>();
+ final SQLiteDatabase db = DBHelper.getInstance().getReadableDatabase();
+ Cursor cursorDeviceList = db.query(Devices.TABLE_NAME,
+ null, null, null, null, null, Devices.Columns._ID + " ASC");
+ while(cursorDeviceList.moveToNext()){
+ devicesList.add(new Devices(cursorDeviceList));
+ }
+ cursorDeviceList.close();
+ return devicesList;
+ }
+
+ public synchronized Devices getDeviceDetails(int device_id){
+ Devices devices;
+ final SQLiteDatabase db = DBHelper.getInstance().getReadableDatabase();
+ final String selectionDevice = Devices.Columns.DEVICE_ID + " = ? ";
+ final String [] selectionArgsDevices = {String.valueOf(device_id)};
+ Cursor cursorDevice = db.query(Devices.TABLE_NAME, null,
+ selectionDevice, selectionArgsDevices, null, null, null);
+ if(cursorDevice.moveToNext()) {
+ devices = new Devices(cursorDevice);
+ }else{
+ devices = new Devices();
+ }
+
+ return devices;
+ }
+
+
+ /**
+ * Check if there is at least one Product Exist or Not
+ *
+ * @return {@link java.lang.Boolean}
+ */
+ public synchronized boolean hasAnyDevices(){
+ final SQLiteDatabase db = DBHelper.getInstance().getReadableDatabase();
+ return DatabaseUtils.longForQuery(db, "SELECT COUNT(*) FROM " + Devices.TABLE_NAME
+ + " LIMIT 1", null) > 0 ;
+ }
+}
diff --git a/app/src/main/java/com/infinity/massive/utils/Utils.java b/app/src/main/java/com/infinity/massive/utils/Utils.java
new file mode 100644
index 0000000..875b03c
--- /dev/null
+++ b/app/src/main/java/com/infinity/massive/utils/Utils.java
@@ -0,0 +1,35 @@
+package com.infinity.massive.utils;
+
+import android.content.Context;
+import android.net.ConnectivityManager;
+import android.net.NetworkInfo;
+
+import com.infinity.massive.ApplicationMassiveInfinity;
+
+/**
+ * Created by Ilanthirayan on 25/1/16.
+ */
+public class Utils {
+
+ /**
+ * Checks whether there's connection to Internet.
+ *
+ * @return true if there's connection or false otherwise
+ */
+ public static boolean isOnline() {
+ ConnectivityManager cm = (ConnectivityManager) ApplicationMassiveInfinity.getContext().getSystemService(Context.CONNECTIVITY_SERVICE);
+
+ NetworkInfo wifiNetwork = cm.getNetworkInfo(ConnectivityManager.TYPE_WIFI);
+ if (wifiNetwork != null && wifiNetwork.isConnected()) {
+ return true;
+ }
+
+ NetworkInfo mobileNetwork = cm.getNetworkInfo(ConnectivityManager.TYPE_MOBILE);
+ if (mobileNetwork != null && mobileNetwork.isConnected()) {
+ return true;
+ }
+
+ NetworkInfo activeNetwork = cm.getActiveNetworkInfo();
+ return activeNetwork != null && activeNetwork.isConnected();
+ }
+}
diff --git a/app/src/main/java/com/infinity/massive/view/activity/AndroidVersionDetailsActivity.java b/app/src/main/java/com/infinity/massive/view/activity/AndroidVersionDetailsActivity.java
new file mode 100644
index 0000000..2809787
--- /dev/null
+++ b/app/src/main/java/com/infinity/massive/view/activity/AndroidVersionDetailsActivity.java
@@ -0,0 +1,161 @@
+package com.infinity.massive.view.activity;
+
+import android.os.Bundle;
+import android.support.v7.app.AppCompatActivity;
+import android.support.v7.widget.Toolbar;
+import android.util.Log;
+import android.view.MenuItem;
+import android.view.View;
+import android.widget.ImageView;
+import android.widget.ProgressBar;
+import android.widget.RelativeLayout;
+import android.widget.TextView;
+
+import com.infinity.massive.R;
+import com.infinity.massive.controller.AndroidVersionController;
+import com.infinity.massive.model.pojo.Android;
+import com.infinity.massive.model.pojo.Devices;
+import com.infinity.massive.utils.DataBaseClient;
+import com.squareup.picasso.Picasso;
+
+import retrofit.Call;
+import retrofit.Callback;
+import retrofit.Response;
+import retrofit.Retrofit;
+
+/**
+ * Created by Ilanthirayan on 26/1/16.
+ */
+public class AndroidVersionDetailsActivity extends AppCompatActivity {
+
+ private static final String TAG = AndroidVersionDetailsActivity.class.getSimpleName();
+
+ public static final String EXTRAS_MASSIVE_INFINITY_DEVICE_ID = "extra_massive_infinity_device_id";
+
+ private RelativeLayout emptyOrLoadingLayout;
+ private ProgressBar loadingProgress;
+ private TextView emptyMessageTxt;
+ private Toolbar toolbar;
+
+ private int device_id;
+ private Devices device;
+ private Android androidVersionObj;
+
+ private ImageView deviceImg;
+ private TextView deviceNameTxt;
+ private TextView deviceIdTxt;
+ private TextView deviceDescriptionTxt;
+ private TextView androidVersionTxt;
+
+
+ //ANDROID VERSION
+ private TextView androidVersionCodeNameTxt;
+ private TextView androidVersionName;
+ private TextView androidVersionTarget;
+ private TextView androidVersionDistribution;
+ private TextView androidVersion;
+
+
+
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.activity_android_version_details);
+
+ //ACTION TOOL BAR
+ toolbar = (Toolbar) findViewById(R.id.toolbar);
+
+ setSupportActionBar(toolbar);
+ getSupportActionBar().setDisplayHomeAsUpEnabled(true);
+ setTitle("Android Version");
+
+ emptyOrLoadingLayout = (RelativeLayout) findViewById(R.id.loading_empty_msg_layout);
+ emptyMessageTxt = (TextView) findViewById(R.id.empty_message_txt);
+ loadingProgress = (ProgressBar) findViewById(R.id.progressAndroidVersionDetailsLayout);
+ deviceNameTxt = (TextView) findViewById(R.id.device_name_txt);
+ deviceIdTxt = (TextView) findViewById(R.id.device_description_txt);
+ deviceDescriptionTxt = (TextView) findViewById(R.id.device_id_txt);
+ androidVersionTxt = (TextView) findViewById(R.id.android_version_txt);
+ deviceImg = (ImageView)findViewById(R.id.device_image);
+
+ androidVersionCodeNameTxt = (TextView) findViewById(R.id.android_version_code_name_txt);
+ androidVersionName = (TextView) findViewById(R.id.android_version_name_txt);
+ androidVersionTarget = (TextView) findViewById(R.id.android_version_target_txt);
+ androidVersionDistribution = (TextView) findViewById(R.id.android_version_distribution_txt);
+ androidVersion = (TextView) findViewById(R.id.android_version_version_txt);
+
+ Bundle extras = getIntent().getExtras();
+
+ if(extras != null) {
+ device_id = extras.getInt(EXTRAS_MASSIVE_INFINITY_DEVICE_ID);
+ /*
+ * Instead of getting over the internet can from SQLite
+ * which has been save already.
+ */
+ getDeviceDetailsFromDataBase();
+ }else{
+ loadingProgress.setVisibility(View.GONE);
+ emptyMessageTxt.setVisibility(View.VISIBLE);
+ }
+ }
+
+ private void getDeviceDetailsFromDataBase(){
+ device = DataBaseClient.getInstance().getDeviceDetails(device_id);
+ if(device != null){
+ emptyOrLoadingLayout.setVisibility(View.GONE);
+ deviceNameTxt.setText(device.getName());
+ deviceDescriptionTxt.setText(device.getSnippet());
+ deviceIdTxt.setText("Device ID :: "+String.valueOf(device.getId()));
+ androidVersionTxt.setText("Android ID :: " +device.getAndroidId());
+ //Get the product image
+ if(device.getImageUrl() != null) {
+ Picasso.with(this).load(device.getImageUrl()).into(deviceImg);
+ }
+ getAndroidVersionDetails();
+ }else{
+ loadingProgress.setVisibility(View.GONE);
+ emptyMessageTxt.setVisibility(View.VISIBLE);
+ }
+ }
+
+ private void getAndroidVersionDetails() {
+ AndroidVersionController mAndroidVersionController = new AndroidVersionController();
+ Call response = mAndroidVersionController.getProductDetailsService(device.getAndroidId());
+ response.enqueue(new Callback() {
+ @Override
+ public void onResponse(Response response, Retrofit retrofit) {
+ Log.d(TAG, "Response Raw :: " + response.raw());
+ if (response.body() != null) {
+ //SUCCESSFULLY ANDROID VERSION RECEIVE
+ androidVersionObj = response.body();
+
+ androidVersionCodeNameTxt.setText(androidVersionObj.getCodename());
+ androidVersionName.setText(androidVersionObj.getName());
+ androidVersionTarget.setText(androidVersionObj.getTarget());
+ androidVersionDistribution.setText(androidVersionObj.getDistribution());
+ androidVersion.setText(androidVersionObj.getVersion());
+ }else{
+ findViewById(R.id.android_version_layout).setVisibility(View.GONE);
+ }
+ }
+
+ @Override
+ public void onFailure(Throwable e) {
+ Log.d(TAG, "onFailure: " + e.getMessage());
+ findViewById(R.id.android_version_layout).setVisibility(View.GONE);
+ }
+ });
+ }
+
+ @Override
+ public boolean onOptionsItemSelected(MenuItem item) {
+ switch (item.getItemId()) {
+ case android.R.id.home:
+ onBackPressed();
+ return true;
+ default:
+ return super.onOptionsItemSelected(item);
+ }
+ }
+
+}
diff --git a/app/src/main/java/com/infinity/massive/view/activity/DeviceListActivity.java b/app/src/main/java/com/infinity/massive/view/activity/DeviceListActivity.java
new file mode 100644
index 0000000..1c232a9
--- /dev/null
+++ b/app/src/main/java/com/infinity/massive/view/activity/DeviceListActivity.java
@@ -0,0 +1,115 @@
+package com.infinity.massive.view.activity;
+
+import android.os.Build;
+import android.os.Bundle;
+import android.os.Handler;
+import android.support.design.widget.NavigationView;
+import android.support.v4.app.Fragment;
+import android.support.v4.app.FragmentManager;
+import android.support.v4.view.GravityCompat;
+import android.support.v4.widget.DrawerLayout;
+import android.support.v7.app.ActionBarDrawerToggle;
+import android.support.v7.app.AppCompatActivity;
+import android.support.v7.widget.Toolbar;
+import android.view.View;
+import android.view.MenuItem;
+
+import com.infinity.massive.R;
+import com.infinity.massive.view.fragment.DeviceListFragment;
+
+public class DeviceListActivity extends AppCompatActivity implements NavigationView.OnNavigationItemSelectedListener {
+
+
+ private static final long DRAWER_CLOSE_DELAY_MS = 250;
+
+ private Fragment fragment;
+
+ private DrawerLayout mDrawerLayout;
+ private Toolbar toolbar;
+ private NavigationView navigationView;
+
+ private ActionBarDrawerToggle mDrawerToggle;
+ private int mNavItemId;
+ private final Handler mDrawerActionHandler = new Handler();
+
+
+ @Override
+ public void onBackPressed(){
+ if (mDrawerLayout.isDrawerOpen(GravityCompat.START)) {
+ mDrawerLayout.closeDrawer(GravityCompat.START);
+ return;
+ }
+ super.onBackPressed();
+ }
+
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.activity_device_list);
+
+ if(android.os.Build.VERSION.SDK_INT > Build.VERSION_CODES.KITKAT){
+ getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_STABLE
+ | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN);
+ }
+
+ mDrawerLayout = (DrawerLayout) findViewById(R.id.main_drawer_layout);
+
+
+ toolbar = (Toolbar) findViewById(R.id.toolbar);
+ setSupportActionBar(toolbar);
+ getSupportActionBar().setDisplayShowHomeEnabled(true);
+
+ // load saved navigation state if present
+ if (null == savedInstanceState) {
+ mNavItemId = R.id.nav_home;
+ }
+
+ navigationView = (NavigationView) findViewById(R.id.nav_view);
+ if (navigationView != null) {
+ navigationView.setNavigationItemSelectedListener(this);
+ }
+
+ // set up the hamburger icon to open and close the drawer
+ mDrawerToggle = new ActionBarDrawerToggle(this, mDrawerLayout, toolbar, R.string.open,
+ R.string.close);
+ mDrawerLayout.setDrawerListener(mDrawerToggle);
+ mDrawerToggle.syncState();
+
+ //initialise drawer menu selection
+ navigate(mNavItemId);
+
+ fragment = DeviceListFragment.getInstance(this);
+ FragmentManager fragmentManager = getSupportFragmentManager();
+ fragmentManager.beginTransaction().replace(R.id.home_screen_container, fragment).commit();
+
+ }
+
+ @Override
+ public boolean onNavigationItemSelected(MenuItem menuItem) {
+ mNavItemId = menuItem.getItemId();
+
+ // allow some time after closing the drawer before performing real navigation
+ // so the user can see what is happening
+ mDrawerLayout.closeDrawer(GravityCompat.START);
+ mDrawerActionHandler.postDelayed(new Runnable() {
+ @Override
+ public void run() {
+ navigate(mNavItemId);
+ }
+ }, DRAWER_CLOSE_DELAY_MS);
+ return true;
+ }
+
+
+ private void navigate(final int itemId) {
+ // select the correct nav menu item
+ navigationView.getMenu().findItem(R.id.nav_home).setChecked(true);
+
+ switch(itemId){
+ case R.id.nav_home:
+ break;
+ default:
+ break;
+ }
+ }
+}
diff --git a/app/src/main/java/com/infinity/massive/view/fragment/DeviceListFragment.java b/app/src/main/java/com/infinity/massive/view/fragment/DeviceListFragment.java
new file mode 100644
index 0000000..b3724a3
--- /dev/null
+++ b/app/src/main/java/com/infinity/massive/view/fragment/DeviceListFragment.java
@@ -0,0 +1,134 @@
+package com.infinity.massive.view.fragment;
+
+import android.app.Activity;
+import android.content.BroadcastReceiver;
+import android.content.Context;
+import android.content.Intent;
+import android.content.IntentFilter;
+import android.os.Bundle;
+import android.support.annotation.Nullable;
+import android.support.v4.app.Fragment;
+import android.support.v7.widget.DefaultItemAnimator;
+import android.support.v7.widget.GridLayoutManager;
+import android.support.v7.widget.RecyclerView;
+import android.support.v7.widget.StaggeredGridLayoutManager;
+import android.util.Log;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.ProgressBar;
+import android.widget.TextView;
+
+import com.infinity.massive.ApplicationMassiveInfinity;
+import com.infinity.massive.R;
+import com.infinity.massive.controller.service.DeviceDownloadService;
+import com.infinity.massive.model.adapter.DeviceListViewAdapter;
+import com.infinity.massive.model.pojo.Devices;
+import com.infinity.massive.utils.DataBaseClient;
+
+import java.util.List;
+
+/**
+ * Created by Ilanthirayan on 25/1/16.
+ */
+public class DeviceListFragment extends Fragment{
+
+ private static final String TAG = DeviceListFragment.class.getSimpleName();
+
+ private DeviceListViewAdapter adapter;
+ private ProgressBar progressBar;
+ private TextView emptyListText;
+ private Activity mActivity;
+
+ private RecyclerView mRecyclerView;
+
+ private StaggeredGridLayoutManager mStaggeredGridLayoutManager ;
+ private List devicesList;
+
+
+ public static DeviceListFragment getInstance(Activity mActivity){
+ DeviceListFragment fragment = new DeviceListFragment();
+ fragment.mActivity = mActivity;
+ return fragment;
+ }
+
+ final BroadcastReceiver downloadFinishedReceiver = new BroadcastReceiver() {
+ @Override
+ public void onReceive(final Context context, final Intent intent) {
+ displayEmptyOrList();
+ }
+ };
+
+ @Override
+ public final void onDestroy(){
+ super.onDestroy();
+ ApplicationMassiveInfinity.getLbm().unregisterReceiver(downloadFinishedReceiver);
+ }
+
+ @Override
+ public void onAttach(Context context) {
+ super.onAttach(context);
+ DeviceDownloadService.start(false, null);
+ }
+
+ protected final void displayEmptyOrList() {
+ if (mActivity == null)
+ return;
+ mActivity.runOnUiThread(new Runnable() {
+ @Override
+ public void run() {
+ final int downloading = DeviceDownloadService.getRemainingBlockRenderProductLayoutDownloads();
+
+ if (downloading > 0) {
+ progressBar.setVisibility(View.VISIBLE);
+ mRecyclerView.setVisibility(View.GONE);
+ emptyListText.setVisibility(View.GONE);
+ Log.d(TAG, "@@displayEmptyOrList showing progress bar");
+ return;
+ }
+
+ if (!DataBaseClient.getInstance().hasAnyDevices()) {
+ progressBar.setVisibility(View.GONE);
+ mRecyclerView.setVisibility(View.GONE);
+ emptyListText.setVisibility(View.VISIBLE);
+ Log.d(TAG, "@@displayEmptyOrList showing empty device list message");
+ return;
+ }
+
+ //NORMAL DISPLAY
+ progressBar.setVisibility(View.GONE);
+ mRecyclerView.setVisibility(View.VISIBLE);
+ emptyListText.setVisibility(View.GONE);
+ initializeAdapter();
+ Log.d(TAG, "@@displayEmptyOrList showing the device list");
+
+ }
+ });
+ }
+
+ private void initializeAdapter(){
+ //initialise here otherwise list will be null
+ devicesList = DataBaseClient.getInstance().getDevices();
+ adapter = new DeviceListViewAdapter(getActivity(), devicesList);
+ mRecyclerView.setAdapter(adapter);
+ }
+
+
+ @Override
+ public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
+ ViewGroup view = (ViewGroup)inflater.inflate(R.layout.fragment_device, container, false);
+
+ progressBar = (ProgressBar) view.findViewById(R.id.progressDeviceLayout);
+ emptyListText = (TextView) view.findViewById(R.id.device_empty_list_msg);
+ ApplicationMassiveInfinity.getLbm().registerReceiver(downloadFinishedReceiver,
+ new IntentFilter(DeviceDownloadService.ACTION_BLOCK_RENDER_DEVICE_DOWNLOAD_FINISHED));
+
+ //CARD VIEW
+ mRecyclerView = (RecyclerView) view.findViewById(R.id.device_recycle_list);
+ mRecyclerView.setHasFixedSize(true);
+ mStaggeredGridLayoutManager = new StaggeredGridLayoutManager(2, StaggeredGridLayoutManager.VERTICAL);
+ mRecyclerView.setLayoutManager(mStaggeredGridLayoutManager);
+
+ return view;
+ }
+}
diff --git a/app/src/main/res/color/nav_text_state.xml b/app/src/main/res/color/nav_text_state.xml
new file mode 100644
index 0000000..d5ec384
--- /dev/null
+++ b/app/src/main/res/color/nav_text_state.xml
@@ -0,0 +1,7 @@
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/drawable-v1/default_profile_image.png b/app/src/main/res/drawable-v1/default_profile_image.png
new file mode 100644
index 0000000..30060b5
Binary files /dev/null and b/app/src/main/res/drawable-v1/default_profile_image.png differ
diff --git a/app/src/main/res/drawable-v1/menu_ic_home.png b/app/src/main/res/drawable-v1/menu_ic_home.png
new file mode 100644
index 0000000..9f61d7b
Binary files /dev/null and b/app/src/main/res/drawable-v1/menu_ic_home.png differ
diff --git a/app/src/main/res/layout/activity_android_version_details.xml b/app/src/main/res/layout/activity_android_version_details.xml
new file mode 100644
index 0000000..24d86af
--- /dev/null
+++ b/app/src/main/res/layout/activity_android_version_details.xml
@@ -0,0 +1,61 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/layout/activity_device_list.xml b/app/src/main/res/layout/activity_device_list.xml
new file mode 100644
index 0000000..66356fc
--- /dev/null
+++ b/app/src/main/res/layout/activity_device_list.xml
@@ -0,0 +1,47 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/layout/adapter_item_device_view.xml b/app/src/main/res/layout/adapter_item_device_view.xml
new file mode 100644
index 0000000..1175da4
--- /dev/null
+++ b/app/src/main/res/layout/adapter_item_device_view.xml
@@ -0,0 +1,81 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/layout/android_version_details_container.xml b/app/src/main/res/layout/android_version_details_container.xml
new file mode 100644
index 0000000..44f415a
--- /dev/null
+++ b/app/src/main/res/layout/android_version_details_container.xml
@@ -0,0 +1,157 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/src/main/res/layout/content_device_list.xml b/app/src/main/res/layout/content_device_list.xml
new file mode 100644
index 0000000..448bc15
--- /dev/null
+++ b/app/src/main/res/layout/content_device_list.xml
@@ -0,0 +1,19 @@
+
+
+
+
+
diff --git a/app/src/main/res/layout/fragment_device.xml b/app/src/main/res/layout/fragment_device.xml
new file mode 100644
index 0000000..2f0474f
--- /dev/null
+++ b/app/src/main/res/layout/fragment_device.xml
@@ -0,0 +1,38 @@
+
+
+
+
+
+
+
+
+
+
diff --git a/app/src/main/res/layout/nav_header.xml b/app/src/main/res/layout/nav_header.xml
new file mode 100644
index 0000000..c7fa9ca
--- /dev/null
+++ b/app/src/main/res/layout/nav_header.xml
@@ -0,0 +1,40 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/layout/progress_item.xml b/app/src/main/res/layout/progress_item.xml
new file mode 100644
index 0000000..10c8c5c
--- /dev/null
+++ b/app/src/main/res/layout/progress_item.xml
@@ -0,0 +1,14 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/menu/drawer_view.xml b/app/src/main/res/menu/drawer_view.xml
new file mode 100644
index 0000000..b44216c
--- /dev/null
+++ b/app/src/main/res/menu/drawer_view.xml
@@ -0,0 +1,11 @@
+
+
\ No newline at end of file
diff --git a/app/src/main/res/menu/menu_device_list.xml b/app/src/main/res/menu/menu_device_list.xml
new file mode 100644
index 0000000..0b61157
--- /dev/null
+++ b/app/src/main/res/menu/menu_device_list.xml
@@ -0,0 +1,10 @@
+
diff --git a/app/src/main/res/menu/menu_home.xml b/app/src/main/res/menu/menu_home.xml
new file mode 100644
index 0000000..992100f
--- /dev/null
+++ b/app/src/main/res/menu/menu_home.xml
@@ -0,0 +1,10 @@
+
\ No newline at end of file
diff --git a/app/src/main/res/mipmap-hdpi/ic_launcher.png b/app/src/main/res/mipmap-hdpi/ic_launcher.png
new file mode 100644
index 0000000..cde69bc
Binary files /dev/null and b/app/src/main/res/mipmap-hdpi/ic_launcher.png differ
diff --git a/app/src/main/res/mipmap-mdpi/ic_launcher.png b/app/src/main/res/mipmap-mdpi/ic_launcher.png
new file mode 100644
index 0000000..c133a0c
Binary files /dev/null and b/app/src/main/res/mipmap-mdpi/ic_launcher.png differ
diff --git a/app/src/main/res/mipmap-xhdpi/ic_launcher.png b/app/src/main/res/mipmap-xhdpi/ic_launcher.png
new file mode 100644
index 0000000..bfa42f0
Binary files /dev/null and b/app/src/main/res/mipmap-xhdpi/ic_launcher.png differ
diff --git a/app/src/main/res/mipmap-xxhdpi/ic_launcher.png b/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
new file mode 100644
index 0000000..324e72c
Binary files /dev/null and b/app/src/main/res/mipmap-xxhdpi/ic_launcher.png differ
diff --git a/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png b/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
new file mode 100644
index 0000000..aee44e1
Binary files /dev/null and b/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png differ
diff --git a/app/src/main/res/values-v21/styles.xml b/app/src/main/res/values-v21/styles.xml
new file mode 100644
index 0000000..251fb9f
--- /dev/null
+++ b/app/src/main/res/values-v21/styles.xml
@@ -0,0 +1,9 @@
+>
+
+
+
diff --git a/app/src/main/res/values-w820dp/dimens.xml b/app/src/main/res/values-w820dp/dimens.xml
new file mode 100644
index 0000000..63fc816
--- /dev/null
+++ b/app/src/main/res/values-w820dp/dimens.xml
@@ -0,0 +1,6 @@
+
+
+ 64dp
+
diff --git a/app/src/main/res/values/colors.xml b/app/src/main/res/values/colors.xml
new file mode 100644
index 0000000..3ab3e9c
--- /dev/null
+++ b/app/src/main/res/values/colors.xml
@@ -0,0 +1,6 @@
+
+
+ #3F51B5
+ #303F9F
+ #FF4081
+
diff --git a/app/src/main/res/values/config.xml b/app/src/main/res/values/config.xml
new file mode 100644
index 0000000..ed998fa
--- /dev/null
+++ b/app/src/main/res/values/config.xml
@@ -0,0 +1,4 @@
+
+
+ http://mobilesandboxdev.azurewebsites.net
+
\ No newline at end of file
diff --git a/app/src/main/res/values/dimens.xml b/app/src/main/res/values/dimens.xml
new file mode 100644
index 0000000..812cb7b
--- /dev/null
+++ b/app/src/main/res/values/dimens.xml
@@ -0,0 +1,6 @@
+
+
+ 16dp
+ 16dp
+ 16dp
+
diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml
new file mode 100644
index 0000000..81807e6
--- /dev/null
+++ b/app/src/main/res/values/strings.xml
@@ -0,0 +1,7 @@
+
+ MassiveInfinity
+ Settings
+ open
+ close
+ Could not find the devices. Please Try again later.
+
diff --git a/app/src/main/res/values/styles.xml b/app/src/main/res/values/styles.xml
new file mode 100644
index 0000000..545b9c6
--- /dev/null
+++ b/app/src/main/res/values/styles.xml
@@ -0,0 +1,20 @@
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/src/test/java/com/infinity/massive/ExampleUnitTest.java b/app/src/test/java/com/infinity/massive/ExampleUnitTest.java
new file mode 100644
index 0000000..0fbbdd7
--- /dev/null
+++ b/app/src/test/java/com/infinity/massive/ExampleUnitTest.java
@@ -0,0 +1,15 @@
+package com.infinity.massive;
+
+import org.junit.Test;
+
+import static org.junit.Assert.*;
+
+/**
+ * To work on unit tests, switch the Test Artifact in the Build Variants view.
+ */
+public class ExampleUnitTest {
+ @Test
+ public void addition_isCorrect() throws Exception {
+ assertEquals(4, 2 + 2);
+ }
+}
\ No newline at end of file
diff --git a/build.gradle b/build.gradle
new file mode 100644
index 0000000..e0b366a
--- /dev/null
+++ b/build.gradle
@@ -0,0 +1,23 @@
+// Top-level build file where you can add configuration options common to all sub-projects/modules.
+
+buildscript {
+ repositories {
+ jcenter()
+ }
+ dependencies {
+ classpath 'com.android.tools.build:gradle:1.5.0'
+
+ // NOTE: Do not place your application dependencies here; they belong
+ // in the individual module build.gradle files
+ }
+}
+
+allprojects {
+ repositories {
+ jcenter()
+ }
+}
+
+task clean(type: Delete) {
+ delete rootProject.buildDir
+}
diff --git a/gradle.properties b/gradle.properties
new file mode 100644
index 0000000..1d3591c
--- /dev/null
+++ b/gradle.properties
@@ -0,0 +1,18 @@
+# Project-wide Gradle settings.
+
+# IDE (e.g. Android Studio) users:
+# Gradle settings configured through the IDE *will override*
+# any settings specified in this file.
+
+# For more details on how to configure your build environment visit
+# http://www.gradle.org/docs/current/userguide/build_environment.html
+
+# Specifies the JVM arguments used for the daemon process.
+# The setting is particularly useful for tweaking memory settings.
+# Default value: -Xmx10248m -XX:MaxPermSize=256m
+# org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
+
+# When configured, Gradle will run in incubating parallel mode.
+# This option should only be used with decoupled projects. More details, visit
+# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
+# org.gradle.parallel=true
\ No newline at end of file
diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar
new file mode 100644
index 0000000..05ef575
Binary files /dev/null and b/gradle/wrapper/gradle-wrapper.jar differ
diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties
new file mode 100644
index 0000000..f23df6e
--- /dev/null
+++ b/gradle/wrapper/gradle-wrapper.properties
@@ -0,0 +1,6 @@
+#Wed Oct 21 11:34:03 PDT 2015
+distributionBase=GRADLE_USER_HOME
+distributionPath=wrapper/dists
+zipStoreBase=GRADLE_USER_HOME
+zipStorePath=wrapper/dists
+distributionUrl=https\://services.gradle.org/distributions/gradle-2.8-all.zip
diff --git a/gradlew b/gradlew
new file mode 100755
index 0000000..9d82f78
--- /dev/null
+++ b/gradlew
@@ -0,0 +1,160 @@
+#!/usr/bin/env bash
+
+##############################################################################
+##
+## Gradle start up script for UN*X
+##
+##############################################################################
+
+# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
+DEFAULT_JVM_OPTS=""
+
+APP_NAME="Gradle"
+APP_BASE_NAME=`basename "$0"`
+
+# Use the maximum available, or set MAX_FD != -1 to use that value.
+MAX_FD="maximum"
+
+warn ( ) {
+ echo "$*"
+}
+
+die ( ) {
+ echo
+ echo "$*"
+ echo
+ exit 1
+}
+
+# OS specific support (must be 'true' or 'false').
+cygwin=false
+msys=false
+darwin=false
+case "`uname`" in
+ CYGWIN* )
+ cygwin=true
+ ;;
+ Darwin* )
+ darwin=true
+ ;;
+ MINGW* )
+ msys=true
+ ;;
+esac
+
+# Attempt to set APP_HOME
+# Resolve links: $0 may be a link
+PRG="$0"
+# Need this for relative symlinks.
+while [ -h "$PRG" ] ; do
+ ls=`ls -ld "$PRG"`
+ link=`expr "$ls" : '.*-> \(.*\)$'`
+ if expr "$link" : '/.*' > /dev/null; then
+ PRG="$link"
+ else
+ PRG=`dirname "$PRG"`"/$link"
+ fi
+done
+SAVED="`pwd`"
+cd "`dirname \"$PRG\"`/" >/dev/null
+APP_HOME="`pwd -P`"
+cd "$SAVED" >/dev/null
+
+CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
+
+# Determine the Java command to use to start the JVM.
+if [ -n "$JAVA_HOME" ] ; then
+ if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
+ # IBM's JDK on AIX uses strange locations for the executables
+ JAVACMD="$JAVA_HOME/jre/sh/java"
+ else
+ JAVACMD="$JAVA_HOME/bin/java"
+ fi
+ if [ ! -x "$JAVACMD" ] ; then
+ die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
+
+Please set the JAVA_HOME variable in your environment to match the
+location of your Java installation."
+ fi
+else
+ JAVACMD="java"
+ which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
+
+Please set the JAVA_HOME variable in your environment to match the
+location of your Java installation."
+fi
+
+# Increase the maximum file descriptors if we can.
+if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then
+ MAX_FD_LIMIT=`ulimit -H -n`
+ if [ $? -eq 0 ] ; then
+ if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
+ MAX_FD="$MAX_FD_LIMIT"
+ fi
+ ulimit -n $MAX_FD
+ if [ $? -ne 0 ] ; then
+ warn "Could not set maximum file descriptor limit: $MAX_FD"
+ fi
+ else
+ warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
+ fi
+fi
+
+# For Darwin, add options to specify how the application appears in the dock
+if $darwin; then
+ GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
+fi
+
+# For Cygwin, switch paths to Windows format before running java
+if $cygwin ; then
+ APP_HOME=`cygpath --path --mixed "$APP_HOME"`
+ CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
+ JAVACMD=`cygpath --unix "$JAVACMD"`
+
+ # We build the pattern for arguments to be converted via cygpath
+ ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
+ SEP=""
+ for dir in $ROOTDIRSRAW ; do
+ ROOTDIRS="$ROOTDIRS$SEP$dir"
+ SEP="|"
+ done
+ OURCYGPATTERN="(^($ROOTDIRS))"
+ # Add a user-defined pattern to the cygpath arguments
+ if [ "$GRADLE_CYGPATTERN" != "" ] ; then
+ OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
+ fi
+ # Now convert the arguments - kludge to limit ourselves to /bin/sh
+ i=0
+ for arg in "$@" ; do
+ CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
+ CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
+
+ if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
+ eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
+ else
+ eval `echo args$i`="\"$arg\""
+ fi
+ i=$((i+1))
+ done
+ case $i in
+ (0) set -- ;;
+ (1) set -- "$args0" ;;
+ (2) set -- "$args0" "$args1" ;;
+ (3) set -- "$args0" "$args1" "$args2" ;;
+ (4) set -- "$args0" "$args1" "$args2" "$args3" ;;
+ (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
+ (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
+ (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
+ (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
+ (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
+ esac
+fi
+
+# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules
+function splitJvmOpts() {
+ JVM_OPTS=("$@")
+}
+eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS
+JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"
+
+exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"
diff --git a/gradlew.bat b/gradlew.bat
new file mode 100644
index 0000000..aec9973
--- /dev/null
+++ b/gradlew.bat
@@ -0,0 +1,90 @@
+@if "%DEBUG%" == "" @echo off
+@rem ##########################################################################
+@rem
+@rem Gradle startup script for Windows
+@rem
+@rem ##########################################################################
+
+@rem Set local scope for the variables with windows NT shell
+if "%OS%"=="Windows_NT" setlocal
+
+@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
+set DEFAULT_JVM_OPTS=
+
+set DIRNAME=%~dp0
+if "%DIRNAME%" == "" set DIRNAME=.
+set APP_BASE_NAME=%~n0
+set APP_HOME=%DIRNAME%
+
+@rem Find java.exe
+if defined JAVA_HOME goto findJavaFromJavaHome
+
+set JAVA_EXE=java.exe
+%JAVA_EXE% -version >NUL 2>&1
+if "%ERRORLEVEL%" == "0" goto init
+
+echo.
+echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
+echo.
+echo Please set the JAVA_HOME variable in your environment to match the
+echo location of your Java installation.
+
+goto fail
+
+:findJavaFromJavaHome
+set JAVA_HOME=%JAVA_HOME:"=%
+set JAVA_EXE=%JAVA_HOME%/bin/java.exe
+
+if exist "%JAVA_EXE%" goto init
+
+echo.
+echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
+echo.
+echo Please set the JAVA_HOME variable in your environment to match the
+echo location of your Java installation.
+
+goto fail
+
+:init
+@rem Get command-line arguments, handling Windowz variants
+
+if not "%OS%" == "Windows_NT" goto win9xME_args
+if "%@eval[2+2]" == "4" goto 4NT_args
+
+:win9xME_args
+@rem Slurp the command line arguments.
+set CMD_LINE_ARGS=
+set _SKIP=2
+
+:win9xME_args_slurp
+if "x%~1" == "x" goto execute
+
+set CMD_LINE_ARGS=%*
+goto execute
+
+:4NT_args
+@rem Get arguments from the 4NT Shell from JP Software
+set CMD_LINE_ARGS=%$
+
+:execute
+@rem Setup the command line
+
+set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
+
+@rem Execute Gradle
+"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
+
+:end
+@rem End local scope for the variables with windows NT shell
+if "%ERRORLEVEL%"=="0" goto mainEnd
+
+:fail
+rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
+rem the _cmd.exe /c_ return code!
+if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
+exit /b 1
+
+:mainEnd
+if "%OS%"=="Windows_NT" endlocal
+
+:omega
diff --git a/settings.gradle b/settings.gradle
new file mode 100644
index 0000000..e7b4def
--- /dev/null
+++ b/settings.gradle
@@ -0,0 +1 @@
+include ':app'