-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 68d70d2
Showing
48 changed files
with
1,422 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
*.iml | ||
.gradle | ||
/local.properties | ||
/.idea/caches/build_file_checksums.ser | ||
/.idea/libraries | ||
/.idea/modules.xml | ||
/.idea/workspace.xml | ||
.DS_Store | ||
/build | ||
/captures | ||
.externalNativeBuild |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
/build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
apply plugin: 'com.android.application' | ||
|
||
android { | ||
compileSdkVersion 28 | ||
defaultConfig { | ||
applicationId "com.example.brunovsiq.viajaserv" | ||
minSdkVersion 19 | ||
targetSdkVersion 28 | ||
versionCode 1 | ||
versionName "1.0" | ||
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" | ||
} | ||
buildTypes { | ||
release { | ||
minifyEnabled false | ||
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' | ||
} | ||
} | ||
} | ||
|
||
dependencies { | ||
implementation fileTree(dir: 'libs', include: ['*.jar']) | ||
implementation 'com.android.support:appcompat-v7:28.0.0' | ||
implementation 'com.google.android.gms:play-services-maps:16.0.0' | ||
implementation 'com.google.android.gms:play-services-maps:15.0.1' | ||
implementation 'com.google.android.gms:play-services-location:15.0.1' | ||
implementation 'com.koushikdutta.ion:ion:2.+' | ||
implementation 'com.google.maps.android:android-maps-utils:0.5+' | ||
implementation 'com.amitshekhar.android:android-networking:1.0.2' | ||
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' | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
26 changes: 26 additions & 0 deletions
26
app/src/androidTest/java/com/example/brunovsiq/viajaserv/ExampleInstrumentedTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package com.example.brunovsiq.viajaserv; | ||
|
||
import android.content.Context; | ||
import android.support.test.InstrumentationRegistry; | ||
import android.support.test.runner.AndroidJUnit4; | ||
|
||
import org.junit.Test; | ||
import org.junit.runner.RunWith; | ||
|
||
import static org.junit.Assert.*; | ||
|
||
/** | ||
* Instrumented test, which will execute on an Android device. | ||
* | ||
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a> | ||
*/ | ||
@RunWith(AndroidJUnit4.class) | ||
public class ExampleInstrumentedTest { | ||
@Test | ||
public void useAppContext() { | ||
// Context of the app under test. | ||
Context appContext = InstrumentationRegistry.getTargetContext(); | ||
|
||
assertEquals("com.example.brunovsiq.viajaserv", appContext.getPackageName()); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<resources> | ||
<!-- | ||
TODO: Before you run your application, you need a Google Maps API key. | ||
To get one, follow this link, follow the directions and press "Create" at the end: | ||
https://console.developers.google.com/flows/enableapi?apiid=maps_android_backend&keyType=CLIENT_SIDE_ANDROID&r=8E:51:EB:A2:1A:5E:86:43:16:4D:16:4B:5A:94:C2:45:35:4D:C1:3E%3Bcom.example.brunovsiq.viajaserv | ||
You can also add your credentials to an existing key, using these values: | ||
Package name: | ||
8E:51:EB:A2:1A:5E:86:43:16:4D:16:4B:5A:94:C2:45:35:4D:C1:3E | ||
SHA-1 certificate fingerprint: | ||
8E:51:EB:A2:1A:5E:86:43:16:4D:16:4B:5A:94:C2:45:35:4D:C1:3E | ||
Alternatively, follow the directions here: | ||
https://developers.google.com/maps/documentation/android/start#get-key | ||
Once you have your key (it starts with "AIza"), replace the "google_maps_key" | ||
string in this file. | ||
--> | ||
<string name="google_maps_key" templateMergeStrategy="preserve" translatable="false">AIzaSyA-FhV7rG9TNg4AIY_AZtglzlD68vsPhQ8</string> | ||
</resources> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<manifest xmlns:android="http://schemas.android.com/apk/res/android" | ||
package="com.example.brunovsiq.viajaserv"> | ||
<!-- | ||
The ACCESS_COARSE/FINE_LOCATION permissions are not required to use | ||
Google Maps Android API v2, but you must specify either coarse or fine | ||
location permissions for the 'MyLocation' functionality. | ||
--> | ||
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" /> | ||
<uses-permission android:name="android.permission.INTERNET"/> | ||
|
||
<application | ||
android:networkSecurityConfig="@xml/network_security_config" | ||
android:allowBackup="true" | ||
android:icon="@mipmap/ic_launcher" | ||
android:label="@string/app_name" | ||
android:roundIcon="@mipmap/ic_launcher_round" | ||
android:supportsRtl="true" | ||
android:theme="@style/AppTheme"> | ||
<!-- | ||
The API key for Google Maps-based APIs is defined as a string resource. | ||
(See the file "res/values/google_maps_api.xml"). | ||
Note that the API key is linked to the encryption key used to sign the APK. | ||
You need a different API key for each encryption key, including the release key that is used to | ||
sign the APK for publishing. | ||
You can define the keys for the debug and release targets in src/debug/ and src/release/. | ||
--> | ||
<meta-data | ||
android:name="com.google.android.geo.API_KEY" | ||
android:value="@string/google_maps_key" /> | ||
|
||
<activity | ||
android:name=".screens.MainActivity" | ||
android:label="@string/title_activity_maps"> | ||
<intent-filter> | ||
<action android:name="android.intent.action.MAIN" /> | ||
|
||
<category android:name="android.intent.category.LAUNCHER" /> | ||
</intent-filter> | ||
</activity> | ||
<activity android:name=".screens.MapsActivity"/> | ||
<activity android:name=".screens.RankingActivity"/> | ||
|
||
<uses-library android:name="org.apache.http.legacy" android:required="false" /> | ||
</application> | ||
|
||
</manifest> |
Large diffs are not rendered by default.
Oops, something went wrong.
77 changes: 77 additions & 0 deletions
77
app/src/main/java/com/example/brunovsiq/viajaserv/models/Local.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
package com.example.brunovsiq.viajaserv.models; | ||
|
||
import com.google.gson.JsonObject; | ||
|
||
import org.json.JSONException; | ||
import org.json.JSONObject; | ||
|
||
import java.util.ArrayList; | ||
|
||
public class Local implements Comparable<Local> { | ||
|
||
private String estado; | ||
private String cidade; | ||
private int quantidade; | ||
private double latitude; | ||
private double longitude; | ||
|
||
public Local(JSONObject jsonObject) { | ||
try { | ||
|
||
this.estado = jsonObject.getString("estado"); | ||
this.cidade = jsonObject.getString("cidade"); | ||
this.quantidade = Integer.parseInt(jsonObject.getString("qtde")); | ||
this.latitude = Double.parseDouble(jsonObject.getString("latitude")); | ||
this.longitude = Double.parseDouble(jsonObject.getString("longitude")); | ||
|
||
} catch (JSONException e) { | ||
e.printStackTrace(); | ||
} | ||
} | ||
|
||
public String getEstado() { | ||
return estado; | ||
} | ||
|
||
public void setEstado(String estado) { | ||
this.estado = estado; | ||
} | ||
|
||
public String getCidade() { | ||
return cidade; | ||
} | ||
|
||
public void setCidade(String cidade) { | ||
this.cidade = cidade; | ||
} | ||
|
||
public int getQuantidade() { | ||
return quantidade; | ||
} | ||
|
||
public void setQuantidade(int quantidade) { | ||
this.quantidade = quantidade; | ||
} | ||
|
||
public double getLatitude() { | ||
return latitude; | ||
} | ||
|
||
public void setLatitude(double latitude) { | ||
this.latitude = latitude; | ||
} | ||
|
||
public double getLongitude() { | ||
return longitude; | ||
} | ||
|
||
public void setLongitude(double longitude) { | ||
this.longitude = longitude; | ||
} | ||
|
||
|
||
@Override | ||
public int compareTo(Local o) { | ||
return o.quantidade - quantidade; | ||
} | ||
} |
35 changes: 35 additions & 0 deletions
35
app/src/main/java/com/example/brunovsiq/viajaserv/models/MyItem.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
package com.example.brunovsiq.viajaserv.models; | ||
|
||
import com.google.android.gms.maps.model.LatLng; | ||
import com.google.maps.android.clustering.ClusterItem; | ||
|
||
public class MyItem implements ClusterItem { | ||
private LatLng mPosition; | ||
private String mTitle; | ||
private String mSnippet; | ||
|
||
public MyItem(double lat, double lng) { | ||
mPosition = new LatLng(lat, lng); | ||
} | ||
|
||
public MyItem(double lat, double lng, String title, String snippet) { | ||
mPosition = new LatLng(lat, lng); | ||
mTitle = title; | ||
mSnippet = snippet; | ||
} | ||
|
||
@Override | ||
public LatLng getPosition() { | ||
return mPosition; | ||
} | ||
|
||
@Override | ||
public String getTitle() { | ||
return mTitle; | ||
} | ||
|
||
@Override | ||
public String getSnippet() { | ||
return mSnippet; | ||
} | ||
} |
Oops, something went wrong.