-
Notifications
You must be signed in to change notification settings - Fork 0
System Setup
The chosen DBMS was PostgreSQL
due to the possibility of distance and route calculations provided by the geography library included in it.
-
The chosen installation was the certified by EnterpriseDB and can be found here.
-
Once the installation completes, the following components should be installed using the
Stack Builder
:- Database Drivers:
- pgJDBC v42.2.2-1
- Spatial Extensions:
- PostGIS 2.5 Bundle for PostgreSQL 11 (64 bit) v2.5.1
- Database Drivers:
-
Launch the application pgAdmin to use PostgreSQL.
-
Object
(navigation bar) Create
Database
Save
- Right click the database or the schema and click
Create Script
. This is used on database creation.
- Right click the database or schema and left click
Query Tool
. - To save a query insert the name of the file in the path after the path is decided.
- Every file must have the extension
.sql
.
The technologies used in the service of the system structure are: * Java Spring * JPA (Java Persistent Application)
To create a project with this configuration go the Spring Initializr site and as dependencies add each one the components (JPA, H, Web).
- Build:
Gradle
. - Language:
Kotlin
. - Spring Boot:
2.1.3
. - Group:
ps.g49
. - Artifact:
social-routing-service
. - Name:
social-routing-service
. - Description:
Social Routing Service
. - Package Name:
ps.49.socialroutingservice
. - Packaging:
Jar
. - Java Version:
8
.
Is needed to follow some configurations in development project when using the Maps SDK for Android in Android Apps.
- Download Android Studio.
- The Google Play services SDK Installation.
- Get a Google Maps API key.
Follow the guides to download and install Android Studio.
To develop an app using the Google Play services APIs
, is necessary set up the project with the Google Play services SDK, which is available from the Google maven repository.
To test apps when using the Google Play services SDK, must be used either:
- A compatible Android device that runs Android 4.1 or higher and includes Google Play Store.
- The Android emulator with an
AVD
that runs the Google APIs platform based on Android 4.2.2 or higher.
To make the Google Play services APIs available to an app:
- Open the
build.gradle
file inside the application module directory. - Add a new build rule under
dependencies
for the latest version ofplay-services
, using one of the APIs listed. - Ensure that a top-level build.gradle contains a reference to the
google()
repo or tomaven { url "https://maven.google.com" }
. - Save the changes, and click Sync Project with Gradle Files in the toolbar.
Because each app uses Google Play services differently, it's up to you decide the appropriate place in your app to verify the Google Play services version. For example, if Google Play services is required for your app at all times, you might want to do it when your app first launches. On the other hand, if Google Play services is an optional part of your app, you can check the version only once the user navigates to that portion of your app.
Another approach is to use the isGooglePlayServicesAvailable()
method. You get a reference to the singleton object that provides this method using GoogleApiAvailability.getInstance()
. You might call this method in the onResume()
method of the main activity. If the result code is SUCCESS
, then the Google Play services APK is up-to-date and you can continue to make a connection. If, however, the result code is SERVICE_MISSING
, SERVICE_VERSION_UPDATE_REQUIRED
, or SERVICE_DISABLED
, then the user needs to install an update. In this case, call the getErrorDialog()
method and pass it the result error code. The method returns a Dialog
you should show, which provides an appropriate message about the error and provides an action that takes the user to Google Play Store to install the update.
The application needs an API key to access the Google Maps servers. The type of key needed is an API key with restriction for Android apps. The key is free. You can use it with any applications that call the Maps SDK for Android, and it supports an unlimited number of users.
Choose one of the following ways to get your API key from Android Studio:
-
The fast, easy way: Use the link provided in the
google_maps_api.xml
file that Android Studio created for you:- Copy the link provided in the
google_maps_api.xml
file and paste it into your browser. The link takes you to the Google Cloud Platform Console and supplies the required information to the Google Cloud Platform Console via URL parameters, thus reducing the manual input required from you. - Follow the instructions to create a new project on the Google Cloud Platform Console or select an existing project.
- Create an Android-restricted API Key to project.
- Copy the resulting API key, go back to Android Studio, and paste the API key into the
<string>
element in thegoogle_maps_api.xml
file.
- Copy the link provided in the
-
A slightly less fast way: Use the credentials provided in the
google_maps_api.xml
file that Android Studio created for you:- Copy the credentials provided in the
google_maps_api.xml
file. - Go to the Google Cloud Platform Console in your browser.
- Use the copied credentials to add the app to an existing API key or to create a new API key.
- Copy the credentials provided in the
- The full process for getting an API key: If neither of the above options works for your situation, follow the complete process.
Steps to include the API Key in application's manifest, contained in the file AndroidManifest.xml
.
- In AndroidManifest.xml, add the following element as a child of the
<application>
element, by inserting it just before the closing</application>
tag:
<meta-data
android:name="com.google.android.geo.API_KEY"
android:value="YOUR_API_KEY"/>
- Save
AndroidManifest.xml
and re-build the application.
In order to perform network operations in your application, your manifest must include the following permissions:
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />