diff --git a/AppList/.gitignore b/AppList/.gitignore new file mode 100644 index 0000000..2b75303 --- /dev/null +++ b/AppList/.gitignore @@ -0,0 +1,13 @@ +*.iml +.gradle +/local.properties +/.idea/caches +/.idea/libraries +/.idea/modules.xml +/.idea/workspace.xml +/.idea/navEditor.xml +/.idea/assetWizardSettings.xml +.DS_Store +/build +/captures +.externalNativeBuild diff --git a/AppList/.idea/codeStyles/Project.xml b/AppList/.idea/codeStyles/Project.xml new file mode 100644 index 0000000..30aa626 --- /dev/null +++ b/AppList/.idea/codeStyles/Project.xml @@ -0,0 +1,29 @@ + + + + + + + + + + + + + + \ No newline at end of file diff --git a/AppList/.idea/gradle.xml b/AppList/.idea/gradle.xml new file mode 100644 index 0000000..2996d53 --- /dev/null +++ b/AppList/.idea/gradle.xml @@ -0,0 +1,15 @@ + + + + + + \ No newline at end of file diff --git a/AppList/.idea/misc.xml b/AppList/.idea/misc.xml new file mode 100644 index 0000000..af0bbdd --- /dev/null +++ b/AppList/.idea/misc.xml @@ -0,0 +1,14 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/AppList/.idea/runConfigurations.xml b/AppList/.idea/runConfigurations.xml new file mode 100644 index 0000000..7f68460 --- /dev/null +++ b/AppList/.idea/runConfigurations.xml @@ -0,0 +1,12 @@ + + + + + + \ No newline at end of file diff --git a/AppList/app/.gitignore b/AppList/app/.gitignore new file mode 100644 index 0000000..796b96d --- /dev/null +++ b/AppList/app/.gitignore @@ -0,0 +1 @@ +/build diff --git a/AppList/app/build.gradle b/AppList/app/build.gradle new file mode 100644 index 0000000..633c619 --- /dev/null +++ b/AppList/app/build.gradle @@ -0,0 +1,28 @@ +apply plugin: 'com.android.application' + +android { + compileSdkVersion 28 + defaultConfig { + applicationId "com.example.israel.applist" + minSdkVersion 21 + targetSdkVersion 28 + versionCode 1 + versionName "1.0" + testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" + } + buildTypes { + release { + minifyEnabled false + proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' + } + } +} + +dependencies { + implementation fileTree(dir: 'libs', include: ['*.jar']) + implementation 'com.android.support:appcompat-v7:28.0.0' + implementation 'com.android.support.constraint:constraint-layout:1.1.3' + testImplementation 'junit:junit:4.12' + androidTestImplementation 'com.android.support.test:runner:1.0.2' + androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2' +} diff --git a/AppList/app/proguard-rules.pro b/AppList/app/proguard-rules.pro new file mode 100644 index 0000000..f1b4245 --- /dev/null +++ b/AppList/app/proguard-rules.pro @@ -0,0 +1,21 @@ +# Add project specific ProGuard rules here. +# You can control the set of applied configuration files using the +# proguardFiles setting in build.gradle. +# +# For more details, see +# http://developer.android.com/guide/developing/tools/proguard.html + +# If your project uses WebView with JS, uncomment the following +# and specify the fully qualified class name to the JavaScript interface +# class: +#-keepclassmembers class fqcn.of.javascript.interface.for.webview { +# public *; +#} + +# Uncomment this to preserve the line number information for +# debugging stack traces. +#-keepattributes SourceFile,LineNumberTable + +# If you keep the line number information, uncomment this to +# hide the original source file name. +#-renamesourcefileattribute SourceFile diff --git a/AppList/app/src/androidTest/java/com/example/israel/applist/ExampleInstrumentedTest.java b/AppList/app/src/androidTest/java/com/example/israel/applist/ExampleInstrumentedTest.java new file mode 100644 index 0000000..a7187db --- /dev/null +++ b/AppList/app/src/androidTest/java/com/example/israel/applist/ExampleInstrumentedTest.java @@ -0,0 +1,26 @@ +package com.example.israel.applist; + +import android.content.Context; +import android.support.test.InstrumentationRegistry; +import android.support.test.runner.AndroidJUnit4; + +import org.junit.Test; +import org.junit.runner.RunWith; + +import static org.junit.Assert.*; + +/** + * Instrumented test, which will execute on an Android device. + * + * @see Testing documentation + */ +@RunWith(AndroidJUnit4.class) +public class ExampleInstrumentedTest { + @Test + public void useAppContext() { + // Context of the app under test. + Context appContext = InstrumentationRegistry.getTargetContext(); + + assertEquals("com.example.israel.applist", appContext.getPackageName()); + } +} diff --git a/AppList/app/src/main/AndroidManifest.xml b/AppList/app/src/main/AndroidManifest.xml new file mode 100644 index 0000000..68b43be --- /dev/null +++ b/AppList/app/src/main/AndroidManifest.xml @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/AppList/app/src/main/java/com/example/israel/applist/AppListing.java b/AppList/app/src/main/java/com/example/israel/applist/AppListing.java new file mode 100644 index 0000000..6f204b1 --- /dev/null +++ b/AppList/app/src/main/java/com/example/israel/applist/AppListing.java @@ -0,0 +1,47 @@ +package com.example.israel.applist; + +import java.io.Serializable; + +public class AppListing implements Serializable { + + public AppListing(String id, String appName, String appVersion, String domainName, String contactEmail, String imageUrl) { + this.id = id; + this.appName = appName; + this.appVersion = appVersion; + this.domainName = domainName; + this.contactEmail = contactEmail; + this.imageUrl = imageUrl; + } + + private String id; + private String appName; + private String appVersion; + private String domainName; + private String contactEmail; + private String imageUrl; + + public String getId() { + return id; + } + + public String getAppName() { + return appName; + } + + public String getAppVersion() { + return appVersion; + } + + public String getDomainName() { + return domainName; + } + + public String getContactEmail() { + return contactEmail; + } + + public String getImageUrl() { + return imageUrl; + } + +} diff --git a/AppList/app/src/main/java/com/example/israel/applist/AppListingDetailsActivity.java b/AppList/app/src/main/java/com/example/israel/applist/AppListingDetailsActivity.java new file mode 100644 index 0000000..1592e10 --- /dev/null +++ b/AppList/app/src/main/java/com/example/israel/applist/AppListingDetailsActivity.java @@ -0,0 +1,37 @@ +package com.example.israel.applist; + +import android.content.Intent; +import android.support.v7.app.AppCompatActivity; +import android.os.Bundle; +import android.widget.TextView; + +public class AppListingDetailsActivity extends AppCompatActivity { + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_app_listing_details); + + Intent intent = getIntent(); + AppListing appListing = (AppListing) intent.getSerializableExtra("app listing"); + + TextView idTextView = findViewById(R.id.text_view_id); + idTextView.setText("Id: " + appListing.getId()); + + TextView nameTextView = findViewById(R.id.text_view_name); + nameTextView.setText("Name: " + appListing.getAppName()); + + TextView versionTextView = findViewById(R.id.text_view_version); + versionTextView.setText("Version: " + appListing.getAppVersion()); + + TextView domainTextView = findViewById(R.id.text_view_domain); + domainTextView.setText("Domain: " + appListing.getDomainName()); + + TextView contactTextView = findViewById(R.id.text_view_contact); + contactTextView.setText("Contact: " + appListing.getContactEmail()); + + TextView imageUrlTextView = findViewById(R.id.text_view_image_url); + imageUrlTextView.setText("Image: " + appListing.getImageUrl()); + + } +} diff --git a/AppList/app/src/main/java/com/example/israel/applist/AppRepository.java b/AppList/app/src/main/java/com/example/israel/applist/AppRepository.java new file mode 100644 index 0000000..80a52e1 --- /dev/null +++ b/AppList/app/src/main/java/com/example/israel/applist/AppRepository.java @@ -0,0 +1,166 @@ +package com.example.israel.applist; + +import java.util.ArrayList; + +public class AppRepository { + + private static ArrayList appListings; + + public static ArrayList getAppListings() { + if (appListings == null) { + parseData(); + } + + return appListings; + } + + private static void parseData() { + appListings = new ArrayList<>(APP_DATA.length()); + + String[] lines = APP_DATA.split("\n"); + + for (int i = 1; i < lines.length; ++i) { + String[] data = lines[i].split(","); + + // looping through data prevents error for an incomplete csv row + // but still allow data to be read + String id = null; + String appName = null; + String appVersion = null; + String domainName = null; + String contactEmail = null; + String imageUrl = null; + for (int j = 0; j < data.length; ++j) { + switch (j) { + case 0: id = data[j]; break; + case 1: appName = data[j]; break; + case 2: appVersion = data[j]; break; + case 3: domainName = data[j]; break; + case 4: contactEmail = data[j]; break; + case 5: imageUrl = data[j]; break; + } + } + + appListings.add(new AppListing( + id, + appName, + appVersion, + domainName, + contactEmail, + imageUrl + )); + + // this can cause an index oob if a csv row is incomplete +// appListings.add(new AppListing( +// data[0], +// data[1], +// data[2], +// data[3], +// data[4], +// data[5] +// )); + } + } + + private static final String APP_DATA = "id,app_name,app_version,domain_name,contact_email,image_url\n" + + "1,Tresom,0.18,php.net,bboick0@bravesites.com,http://dummyimage.com/169x140.jpg/dddddd/000000\n" + + "2,Cookley,0.86,cbslocal.com,jkobierra1@webs.com,http://dummyimage.com/131x216.bmp/cc0000/ffffff\n" + + "3,Zoolab,3.09,economist.com,istiling2@wikipedia.org,http://dummyimage.com/241x129.jpg/5fa2dd/ffffff\n" + + "4,Job,3.74,google.it,npaeckmeyer3@go.com,http://dummyimage.com/148x177.jpg/dddddd/000000\n" + + "5,Voltsillam,7.15,xrea.com,cdevillier4@imgur.com,http://dummyimage.com/163x100.jpg/5fa2dd/ffffff\n" + + "6,Span,5.27,indiatimes.com,cwahlberg5@mozilla.com,http://dummyimage.com/151x131.png/dddddd/000000\n" + + "7,Subin,0.37,cam.ac.uk,bstriker6@pcworld.com,http://dummyimage.com/156x192.png/dddddd/000000\n" + + "8,Mat Lam Tam,1.50,wikimedia.org,gsawtell7@vinaora.com,http://dummyimage.com/127x171.bmp/ff4444/ffffff\n" + + "9,Lotstring,9.7,feedburner.com,dmacfarlane8@unc.edu,http://dummyimage.com/210x219.jpg/5fa2dd/ffffff\n" + + "10,Latlux,3.1,yahoo.com,cbehr9@chron.com,http://dummyimage.com/147x219.png/dddddd/000000\n" + + "11,Daltfresh,0.31,ehow.com,kfishbournea@angelfire.com,http://dummyimage.com/172x205.jpg/cc0000/ffffff\n" + + "12,Asoka,1.51,xing.com,fmcilvaneyb@yellowpages.com,http://dummyimage.com/215x232.jpg/ff4444/ffffff\n" + + "13,Duobam,9.3,edublogs.org,pwilflingc@ucoz.com,http://dummyimage.com/128x199.jpg/dddddd/000000\n" + + "14,Zaam-Dox,3.00,sun.com,bcaultond@techcrunch.com,http://dummyimage.com/147x153.bmp/5fa2dd/ffffff\n" + + "15,Zaam-Dox,0.2.1,psu.edu,rtuillere@ucla.edu,http://dummyimage.com/177x172.png/dddddd/000000\n" + + "16,Overhold,0.61,mapquest.com,hhuggonf@is.gd,http://dummyimage.com/135x131.bmp/ff4444/ffffff\n" + + "17,Fix San,0.9.3,newyorker.com,bduplang@example.com,http://dummyimage.com/217x220.png/cc0000/ffffff\n" + + "18,Daltfresh,7.9.0,guardian.co.uk,fjoslinh@wp.com,http://dummyimage.com/189x125.jpg/cc0000/ffffff\n" + + "19,Veribet,1.8.9,theatlantic.com,lhandshearti@theguardian.com,http://dummyimage.com/105x140.png/5fa2dd/ffffff\n" + + "20,Cardify,1.9.1,java.com,aborkinj@phpbb.com,http://dummyimage.com/138x124.bmp/cc0000/ffffff\n" + + "21,It,4.0,homestead.com,broderk@flickr.com,http://dummyimage.com/175x221.png/ff4444/ffffff\n" + + "22,Asoka,0.7.4,constantcontact.com,kyuryatinl@abc.net.au,http://dummyimage.com/231x145.jpg/cc0000/ffffff\n" + + "23,Keylex,5.9.3,cargocollective.com,rrenihanm@tumblr.com,http://dummyimage.com/102x109.bmp/dddddd/000000\n" + + "24,Cardify,0.44,4shared.com,akondratenkon@goo.ne.jp,http://dummyimage.com/105x189.bmp/cc0000/ffffff\n" + + "25,Zontrax,0.97,geocities.com,mloxleyo@tmall.com,http://dummyimage.com/165x181.png/cc0000/ffffff\n" + + "26,Ventosanzap,0.1.7,bbb.org,vlakeyp@photobucket.com,http://dummyimage.com/246x189.jpg/cc0000/ffffff\n" + + "27,Zaam-Dox,0.8.4,chicagotribune.com,ccoppingq@youtube.com,http://dummyimage.com/200x240.jpg/cc0000/ffffff\n" + + "28,Domainer,9.45,wisc.edu,dsaxonr@yelp.com,http://dummyimage.com/235x202.png/dddddd/000000\n" + + "29,Tresom,6.5,illinois.edu,saylesburys@cnn.com,http://dummyimage.com/131x198.png/ff4444/ffffff\n" + + "30,Overhold,2.01,icio.us,mdillowt@edublogs.org,http://dummyimage.com/109x238.jpg/ff4444/ffffff\n" + + "31,Bitchip,5.00,shutterfly.com,tvasselu@biblegateway.com,http://dummyimage.com/238x117.png/5fa2dd/ffffff\n" + + "32,Trippledex,5.65,epa.gov,lgiraudyv@pen.io,http://dummyimage.com/194x160.bmp/ff4444/ffffff\n" + + "33,Flowdesk,1.8,sakura.ne.jp,pkittlesw@berkeley.edu,http://dummyimage.com/213x141.bmp/ff4444/ffffff\n" + + "34,Asoka,8.8,furl.net,fperigoex@ucoz.ru,http://dummyimage.com/246x127.bmp/cc0000/ffffff\n" + + "35,Otcom,0.55,chron.com,cbickersy@last.fm,http://dummyimage.com/225x228.png/ff4444/ffffff\n" + + "36,Overhold,8.7.7,narod.ru,skinverz@japanpost.jp,http://dummyimage.com/243x229.bmp/dddddd/000000\n" + + "37,Y-Solowarm,0.9.2,storify.com,jpanas10@nyu.edu,http://dummyimage.com/213x230.bmp/ff4444/ffffff\n" + + "38,Aerified,0.1.2,i2i.jp,mbagnell11@paginegialle.it,http://dummyimage.com/224x131.bmp/dddddd/000000\n" + + "39,Voyatouch,0.3.4,wordpress.org,dgoscomb12@cpanel.net,http://dummyimage.com/242x212.jpg/ff4444/ffffff\n" + + "40,Stringtough,4.6.9,ox.ac.uk,tbelcham13@whitehouse.gov,http://dummyimage.com/119x101.jpg/dddddd/000000\n" + + "41,Tampflex,2.4,ucsd.edu,bbanasevich14@chronoengine.com,http://dummyimage.com/216x228.bmp/5fa2dd/ffffff\n" + + "42,Lotlux,0.7.1,google.com.br,gwestwater15@posterous.com,http://dummyimage.com/231x225.png/cc0000/ffffff\n" + + "43,Transcof,0.3.1,indiegogo.com,doshesnan16@indiegogo.com,http://dummyimage.com/200x119.jpg/ff4444/ffffff\n" + + "44,Asoka,0.85,tmall.com,rbranca17@soup.io,http://dummyimage.com/226x161.bmp/5fa2dd/ffffff\n" + + "45,Y-find,0.50,whitehouse.gov,bmatschoss18@salon.com,http://dummyimage.com/137x211.bmp/5fa2dd/ffffff\n" + + "46,Sonsing,5.16,mozilla.org,jczadla19@joomla.org,http://dummyimage.com/188x144.bmp/5fa2dd/ffffff\n" + + "47,Tres-Zap,0.7.1,ocn.ne.jp,wmcnaughton1a@t-online.de,http://dummyimage.com/209x232.bmp/cc0000/ffffff\n" + + "48,Tempsoft,5.0,goodreads.com,bsherwyn1b@dropbox.com,http://dummyimage.com/102x199.png/ff4444/ffffff\n" + + "49,Bytecard,0.6.7,amazonaws.com,bdraisey1c@unesco.org,http://dummyimage.com/199x220.bmp/dddddd/000000\n" + + "50,Zamit,1.2,sina.com.cn,wrossander1d@mediafire.com,http://dummyimage.com/246x137.bmp/cc0000/ffffff\n" + + "51,Zaam-Dox,0.8.8,nsw.gov.au,mmashro1e@nasa.gov,http://dummyimage.com/220x242.jpg/5fa2dd/ffffff\n" + + "52,Tin,0.7.6,delicious.com,bhelliker1f@nsw.gov.au,http://dummyimage.com/234x244.png/cc0000/ffffff\n" + + "53,Konklux,8.16,goo.gl,lronnay1g@blogspot.com,http://dummyimage.com/129x141.jpg/ff4444/ffffff\n" + + "54,Biodex,7.4,wisc.edu,apreuvost1h@cdbaby.com,http://dummyimage.com/209x114.bmp/cc0000/ffffff\n" + + "55,Job,5.6.7,slideshare.net,cmcgairl1i@msn.com,http://dummyimage.com/196x213.png/cc0000/ffffff\n" + + "56,Zaam-Dox,8.4.0,hp.com,ldibson1j@state.tx.us,http://dummyimage.com/137x116.bmp/5fa2dd/ffffff\n" + + "57,Veribet,7.5,foxnews.com,opickervance1k@china.com.cn,http://dummyimage.com/191x103.jpg/dddddd/000000\n" + + "58,Greenlam,0.17,acquirethisname.com,bfuster1l@wordpress.com,http://dummyimage.com/248x102.png/dddddd/000000\n" + + "59,Otcom,9.52,newsvine.com,henden1m@blinklist.com,http://dummyimage.com/155x144.png/cc0000/ffffff\n" + + "60,Zontrax,0.36,marriott.com,temor1n@stumbleupon.com,http://dummyimage.com/195x179.jpg/dddddd/000000\n" + + "61,Y-find,6.31,163.com,bbrightey1o@digg.com,http://dummyimage.com/182x103.jpg/5fa2dd/ffffff\n" + + "62,Fintone,1.64,fotki.com,eelleray1p@theguardian.com,http://dummyimage.com/117x107.jpg/cc0000/ffffff\n" + + "63,Solarbreeze,3.7.9,economist.com,spymer1q@flavors.me,http://dummyimage.com/151x161.jpg/cc0000/ffffff\n" + + "64,Subin,0.6.1,cisco.com,sbadgers1r@harvard.edu,http://dummyimage.com/197x248.png/dddddd/000000\n" + + "65,Matsoft,5.36,oakley.com,mrefford1s@exblog.jp,http://dummyimage.com/147x143.png/5fa2dd/ffffff\n" + + "66,Tempsoft,0.19,wikipedia.org,hgovini1t@amazon.de,http://dummyimage.com/130x106.png/cc0000/ffffff\n" + + "67,Aerified,0.8.6,businessinsider.com,dpethybridge1u@twitpic.com,http://dummyimage.com/248x148.bmp/dddddd/000000\n" + + "68,Hatity,9.11,mayoclinic.com,arein1v@seattletimes.com,http://dummyimage.com/242x139.png/ff4444/ffffff\n" + + "69,Pannier,0.74,timesonline.co.uk,jdenys1w@dell.com,http://dummyimage.com/188x237.jpg/ff4444/ffffff\n" + + "70,Bitchip,5.92,networksolutions.com,tstallen1x@technorati.com,http://dummyimage.com/126x188.jpg/5fa2dd/ffffff\n" + + "71,Holdlamis,2.8.2,mapy.cz,cpaulucci1y@earthlink.net,http://dummyimage.com/188x165.jpg/dddddd/000000\n" + + "72,Otcom,6.6.0,un.org,sguilliland1z@bandcamp.com,http://dummyimage.com/162x104.jpg/cc0000/ffffff\n" + + "73,Opela,4.9,boston.com,zgurge20@discovery.com,http://dummyimage.com/100x123.jpg/5fa2dd/ffffff\n" + + "74,Konklux,4.73,netscape.com,kkelinge21@ask.com,http://dummyimage.com/214x153.jpg/dddddd/000000\n" + + "75,Lotlux,3.4,businessweek.com,sdanford22@disqus.com,http://dummyimage.com/136x204.jpg/cc0000/ffffff\n" + + "76,Toughjoyfax,8.37,wired.com,cyeates23@istockphoto.com,http://dummyimage.com/216x212.jpg/ff4444/ffffff\n" + + "77,Zathin,5.01,springer.com,plarose24@apple.com,http://dummyimage.com/203x211.bmp/5fa2dd/ffffff\n" + + "78,Y-find,4.6.3,fema.gov,codriscole25@woothemes.com,http://dummyimage.com/201x140.png/5fa2dd/ffffff\n" + + "79,Gembucket,0.54,liveinternet.ru,jhannaway26@prnewswire.com,http://dummyimage.com/149x242.jpg/5fa2dd/ffffff\n" + + "80,Temp,0.56,seattletimes.com,lclerc27@newyorker.com,http://dummyimage.com/133x199.png/dddddd/000000\n" + + "81,Lotstring,3.02,samsung.com,rdietzler28@mail.ru,http://dummyimage.com/120x249.jpg/ff4444/ffffff\n" + + "82,Tresom,0.88,amazon.com,scoulsen29@examiner.com,http://dummyimage.com/218x179.bmp/cc0000/ffffff\n" + + "83,Fixflex,0.4.2,nasa.gov,fdilley2a@domainmarket.com,http://dummyimage.com/129x119.bmp/dddddd/000000\n" + + "84,Fix San,0.9.5,baidu.com,pmillis2b@europa.eu,http://dummyimage.com/173x235.png/dddddd/000000\n" + + "85,Stim,4.0.8,goo.gl,aadlard2c@google.ru,http://dummyimage.com/161x236.bmp/cc0000/ffffff\n" + + "86,Flexidy,4.38,gov.uk,nrockwill2d@reuters.com,http://dummyimage.com/172x115.bmp/dddddd/000000\n" + + "87,Alpha,6.9.4,163.com,rbussel2e@goodreads.com,http://dummyimage.com/137x129.png/dddddd/000000\n" + + "88,Zaam-Dox,5.2.9,goo.ne.jp,mmollen2f@miitbeian.gov.cn,http://dummyimage.com/172x216.bmp/5fa2dd/ffffff\n" + + "89,Voltsillam,3.6.4,prnewswire.com,mdoneld2g@newsvine.com,http://dummyimage.com/170x165.bmp/cc0000/ffffff\n" + + "90,Transcof,4.8,mozilla.com,rnorthrop2h@npr.org,http://dummyimage.com/216x232.bmp/dddddd/000000\n" + + "91,Stim,9.90,delicious.com,cocollopy2i@fema.gov,http://dummyimage.com/134x131.jpg/5fa2dd/ffffff\n" + + "92,Alphazap,1.2.8,biblegateway.com,sbiss2j@bloglovin.com,http://dummyimage.com/180x172.jpg/dddddd/000000\n" + + "93,Zathin,0.3.2,yahoo.co.jp,ftabary2k@gizmodo.com,http://dummyimage.com/247x200.png/dddddd/000000\n" + + "94,Voyatouch,2.79,discuz.net,awhannel2l@etsy.com,http://dummyimage.com/231x208.jpg/ff4444/ffffff\n" + + "95,Solarbreeze,7.4,chicagotribune.com,agallop2m@1und1.de,http://dummyimage.com/160x149.png/ff4444/ffffff\n" + + "96,Cookley,3.1.3,salon.com,vteese2n@tinypic.com,http://dummyimage.com/220x241.png/5fa2dd/ffffff\n" + + "97,Rank,8.5,trellian.com,dburrass2o@amazon.co.jp,http://dummyimage.com/225x118.png/ff4444/ffffff\n" + + "98,Vagram,9.88,sogou.com,kpresdee2p@alibaba.com,http://dummyimage.com/136x112.jpg/dddddd/000000\n" + + "99,Sonsing,0.63,arizona.edu,npurkins2q@nba.com,http://dummyimage.com/211x219.bmp/5fa2dd/ffffff\n" + + "100,Otcom,2.0,storify.com,cmarzella2r@lulu.com,http://dummyimage.com/111x243.png/cc0000/ffffff"; +} diff --git a/AppList/app/src/main/java/com/example/israel/applist/MainActivity.java b/AppList/app/src/main/java/com/example/israel/applist/MainActivity.java new file mode 100644 index 0000000..0cc2aea --- /dev/null +++ b/AppList/app/src/main/java/com/example/israel/applist/MainActivity.java @@ -0,0 +1,49 @@ +package com.example.israel.applist; + +import android.content.Intent; +import android.support.v7.app.AppCompatActivity; +import android.os.Bundle; +import android.util.TypedValue; +import android.view.View; +import android.widget.LinearLayout; +import android.widget.TextView; + +import java.util.ArrayList; + +public class MainActivity extends AppCompatActivity { + + private LinearLayout appListingsLinearLayout; + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_main); + + appListingsLinearLayout = findViewById(R.id.linear_layout_appListings); + + ArrayList appListings = AppRepository.getAppListings(); + + for (AppListing appListing : appListings) { + createTextView(appListing); + } + } + + private void createTextView(final AppListing appListing) { + TextView newTextView = new TextView(this); + newTextView.setText(appListing.getAppName()); + newTextView.setTextSize(TypedValue.COMPLEX_UNIT_DIP, 30.f); + + newTextView.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + Intent intent = new Intent(MainActivity.this, AppListingDetailsActivity.class); + intent.putExtra("app listing", appListing); + startActivity(intent); + } + }); + + appListingsLinearLayout.addView(newTextView); + + + } +} diff --git a/AppList/app/src/main/res/drawable-v24/ic_launcher_foreground.xml b/AppList/app/src/main/res/drawable-v24/ic_launcher_foreground.xml new file mode 100644 index 0000000..1f6bb29 --- /dev/null +++ b/AppList/app/src/main/res/drawable-v24/ic_launcher_foreground.xml @@ -0,0 +1,34 @@ + + + + + + + + + + + diff --git a/AppList/app/src/main/res/drawable/ic_launcher_background.xml b/AppList/app/src/main/res/drawable/ic_launcher_background.xml new file mode 100644 index 0000000..0d025f9 --- /dev/null +++ b/AppList/app/src/main/res/drawable/ic_launcher_background.xml @@ -0,0 +1,170 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/AppList/app/src/main/res/layout/activity_app_listing_details.xml b/AppList/app/src/main/res/layout/activity_app_listing_details.xml new file mode 100644 index 0000000..4a62949 --- /dev/null +++ b/AppList/app/src/main/res/layout/activity_app_listing_details.xml @@ -0,0 +1,47 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/AppList/app/src/main/res/layout/activity_main.xml b/AppList/app/src/main/res/layout/activity_main.xml new file mode 100644 index 0000000..361b15e --- /dev/null +++ b/AppList/app/src/main/res/layout/activity_main.xml @@ -0,0 +1,36 @@ + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/AppList/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/AppList/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml new file mode 100644 index 0000000..eca70cf --- /dev/null +++ b/AppList/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/AppList/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/AppList/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml new file mode 100644 index 0000000..eca70cf --- /dev/null +++ b/AppList/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/AppList/app/src/main/res/mipmap-hdpi/ic_launcher.png b/AppList/app/src/main/res/mipmap-hdpi/ic_launcher.png new file mode 100644 index 0000000..898f3ed Binary files /dev/null and b/AppList/app/src/main/res/mipmap-hdpi/ic_launcher.png differ diff --git a/AppList/app/src/main/res/mipmap-hdpi/ic_launcher_round.png b/AppList/app/src/main/res/mipmap-hdpi/ic_launcher_round.png new file mode 100644 index 0000000..dffca36 Binary files /dev/null and b/AppList/app/src/main/res/mipmap-hdpi/ic_launcher_round.png differ diff --git a/AppList/app/src/main/res/mipmap-mdpi/ic_launcher.png b/AppList/app/src/main/res/mipmap-mdpi/ic_launcher.png new file mode 100644 index 0000000..64ba76f Binary files /dev/null and b/AppList/app/src/main/res/mipmap-mdpi/ic_launcher.png differ diff --git a/AppList/app/src/main/res/mipmap-mdpi/ic_launcher_round.png b/AppList/app/src/main/res/mipmap-mdpi/ic_launcher_round.png new file mode 100644 index 0000000..dae5e08 Binary files /dev/null and b/AppList/app/src/main/res/mipmap-mdpi/ic_launcher_round.png differ diff --git a/AppList/app/src/main/res/mipmap-xhdpi/ic_launcher.png b/AppList/app/src/main/res/mipmap-xhdpi/ic_launcher.png new file mode 100644 index 0000000..e5ed465 Binary files /dev/null and b/AppList/app/src/main/res/mipmap-xhdpi/ic_launcher.png differ diff --git a/AppList/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png b/AppList/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png new file mode 100644 index 0000000..14ed0af Binary files /dev/null and b/AppList/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png differ diff --git a/AppList/app/src/main/res/mipmap-xxhdpi/ic_launcher.png b/AppList/app/src/main/res/mipmap-xxhdpi/ic_launcher.png new file mode 100644 index 0000000..b0907ca Binary files /dev/null and b/AppList/app/src/main/res/mipmap-xxhdpi/ic_launcher.png differ diff --git a/AppList/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png b/AppList/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png new file mode 100644 index 0000000..d8ae031 Binary files /dev/null and b/AppList/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png differ diff --git a/AppList/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png b/AppList/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png new file mode 100644 index 0000000..2c18de9 Binary files /dev/null and b/AppList/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png differ diff --git a/AppList/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png b/AppList/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png new file mode 100644 index 0000000..beed3cd Binary files /dev/null and b/AppList/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png differ diff --git a/AppList/app/src/main/res/values/colors.xml b/AppList/app/src/main/res/values/colors.xml new file mode 100644 index 0000000..69b2233 --- /dev/null +++ b/AppList/app/src/main/res/values/colors.xml @@ -0,0 +1,6 @@ + + + #008577 + #00574B + #D81B60 + diff --git a/AppList/app/src/main/res/values/strings.xml b/AppList/app/src/main/res/values/strings.xml new file mode 100644 index 0000000..8870e93 --- /dev/null +++ b/AppList/app/src/main/res/values/strings.xml @@ -0,0 +1,3 @@ + + AppList + diff --git a/AppList/app/src/main/res/values/styles.xml b/AppList/app/src/main/res/values/styles.xml new file mode 100644 index 0000000..5885930 --- /dev/null +++ b/AppList/app/src/main/res/values/styles.xml @@ -0,0 +1,11 @@ + + + + + + diff --git a/AppList/app/src/test/java/com/example/israel/applist/ExampleUnitTest.java b/AppList/app/src/test/java/com/example/israel/applist/ExampleUnitTest.java new file mode 100644 index 0000000..c474493 --- /dev/null +++ b/AppList/app/src/test/java/com/example/israel/applist/ExampleUnitTest.java @@ -0,0 +1,17 @@ +package com.example.israel.applist; + +import org.junit.Test; + +import static org.junit.Assert.*; + +/** + * Example local unit test, which will execute on the development machine (host). + * + * @see Testing documentation + */ +public class ExampleUnitTest { + @Test + public void addition_isCorrect() { + assertEquals(4, 2 + 2); + } +} \ No newline at end of file diff --git a/AppList/build.gradle b/AppList/build.gradle new file mode 100644 index 0000000..e11a5b3 --- /dev/null +++ b/AppList/build.gradle @@ -0,0 +1,27 @@ +// Top-level build file where you can add configuration options common to all sub-projects/modules. + +buildscript { + repositories { + google() + jcenter() + + } + dependencies { + classpath 'com.android.tools.build:gradle:3.3.2' + + // NOTE: Do not place your application dependencies here; they belong + // in the individual module build.gradle files + } +} + +allprojects { + repositories { + google() + jcenter() + + } +} + +task clean(type: Delete) { + delete rootProject.buildDir +} diff --git a/AppList/gradle.properties b/AppList/gradle.properties new file mode 100644 index 0000000..82618ce --- /dev/null +++ b/AppList/gradle.properties @@ -0,0 +1,15 @@ +# 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. +org.gradle.jvmargs=-Xmx1536m +# 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 + + diff --git a/AppList/gradle/wrapper/gradle-wrapper.jar b/AppList/gradle/wrapper/gradle-wrapper.jar new file mode 100644 index 0000000..f6b961f Binary files /dev/null and b/AppList/gradle/wrapper/gradle-wrapper.jar differ diff --git a/AppList/gradle/wrapper/gradle-wrapper.properties b/AppList/gradle/wrapper/gradle-wrapper.properties new file mode 100644 index 0000000..7eec804 --- /dev/null +++ b/AppList/gradle/wrapper/gradle-wrapper.properties @@ -0,0 +1,6 @@ +#Thu Mar 21 13:06:18 CDT 2019 +distributionBase=GRADLE_USER_HOME +distributionPath=wrapper/dists +zipStoreBase=GRADLE_USER_HOME +zipStorePath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.1-all.zip diff --git a/AppList/gradlew b/AppList/gradlew new file mode 100644 index 0000000..cccdd3d --- /dev/null +++ b/AppList/gradlew @@ -0,0 +1,172 @@ +#!/usr/bin/env sh + +############################################################################## +## +## Gradle start up script for UN*X +## +############################################################################## + +# 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 + +APP_NAME="Gradle" +APP_BASE_NAME=`basename "$0"` + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS="" + +# 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 +nonstop=false +case "`uname`" in + CYGWIN* ) + cygwin=true + ;; + Darwin* ) + darwin=true + ;; + MINGW* ) + msys=true + ;; + NONSTOP* ) + nonstop=true + ;; +esac + +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" -a "$nonstop" = "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 + +# Escape application args +save () { + for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done + echo " " +} +APP_ARGS=$(save "$@") + +# Collect all arguments for the java command, following the shell quoting and substitution rules +eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS" + +# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong +if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then + cd "$(dirname "$0")" +fi + +exec "$JAVACMD" "$@" diff --git a/AppList/gradlew.bat b/AppList/gradlew.bat new file mode 100644 index 0000000..f955316 --- /dev/null +++ b/AppList/gradlew.bat @@ -0,0 +1,84 @@ +@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 + +set DIRNAME=%~dp0 +if "%DIRNAME%" == "" set DIRNAME=. +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% + +@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= + +@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 Windows variants + +if not "%OS%" == "Windows_NT" goto win9xME_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=%* + +: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/AppList/settings.gradle b/AppList/settings.gradle new file mode 100644 index 0000000..e7b4def --- /dev/null +++ b/AppList/settings.gradle @@ -0,0 +1 @@ +include ':app'