Commit 8157129c2e0afdbb1ed1c961baa8837f3243725e

Authored by kristinlaahneolsen
1 parent e4ad27c9

Begynt å implementere endpoints slik at vi får hentet data fra database gjennom …

…appen. Foreløpig er det kun knyttet til localhost, og på skolenettet vil ikke dette fungere. Dermed må man være tilkoblet mobilnettet for å få teste dette ordentlig. OBS: Hvis man får koblet det opp mot en server, så må man endre BaseURL i Endpoint-fila
Risiko/app/src/main/java/api/Api.java 0 → 100644
  1 +package api;
  2 +
  3 +/**
  4 + * Created by kristinlaahneolsen on 01.11.2018.
  5 + */
  6 +
  7 +public class Api {
  8 +}
... ...
Risiko/app/src/main/java/api/Endpoints.java 0 → 100644
  1 +import java.util.List;
  2 +import java.util.Observable;
  3 +
  4 +import dataclasses.Incident;
  5 +import retrofit2.http.GET;
  6 +
  7 +/**
  8 + * Interface for API Endpoints using Retrofit
  9 + */
  10 +public interface Endpoints {
  11 +
  12 +
  13 +
  14 + String BASEURL = "http://localhost:3000/";
  15 + String API_BASEURL = BASEURL + "api/";
  16 +
  17 +
  18 + @GET("incidents")
  19 + Observable<List<Incident>> /
  20 +}
... ...
restApi/.idea/workspace.xml
... ... @@ -2,8 +2,14 @@
2 2 <project version="4">
3 3 <component name="ChangeListManager">
4 4 <list default="true" id="8a337026-05ab-47b0-872d-ab1e8037e9a0" name="Default" comment="">
  5 + <change beforePath="" afterPath="$PROJECT_DIR$/../Risiko/app/src/main/java/api/Api.java" />
  6 + <change beforePath="" afterPath="$PROJECT_DIR$/../Risiko/app/src/main/java/api/Endpoints.java" />
  7 + <change beforePath="$PROJECT_DIR$/../Risiko/app/build.gradle" afterPath="$PROJECT_DIR$/../Risiko/app/build.gradle" />
  8 + <change beforePath="$PROJECT_DIR$/../Risiko/app/src/main/AndroidManifest.xml" afterPath="$PROJECT_DIR$/../Risiko/app/src/main/AndroidManifest.xml" />
  9 + <change beforePath="$PROJECT_DIR$/../Risiko/app/src/main/java/activity/Activities.java" afterPath="$PROJECT_DIR$/../Risiko/app/src/main/java/activity/Activities.java" />
  10 + <change beforePath="$PROJECT_DIR$/../Risiko/app/src/main/java/activity/Evaluations.java" afterPath="$PROJECT_DIR$/../Risiko/app/src/main/java/activity/Evaluations.java" />
5 11 <change beforePath="$PROJECT_DIR$/.idea/workspace.xml" afterPath="$PROJECT_DIR$/.idea/workspace.xml" />
6   - <change beforePath="$PROJECT_DIR$/api/routes/routes.js" afterPath="$PROJECT_DIR$/api/routes/routes.js" />
  12 + <change beforePath="$PROJECT_DIR$/../~$pport - Distribuert server-klient.docx" afterPath="" />
7 13 </list>
8 14 <option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" />
9 15 <option name="TRACKING_ENABLED" value="true" />
... ... @@ -55,7 +61,7 @@
55 61 <file leaf-file-name="routes.js" pinned="false" current-in-tab="true">
56 62 <entry file="file://$PROJECT_DIR$/api/routes/routes.js">
57 63 <provider selected="true" editor-type-id="text-editor">
58   - <state relative-caret-position="690">
  64 + <state relative-caret-position="-2677">
59 65 <caret line="46" column="0" lean-forward="false" selection-start-line="46" selection-start-column="0" selection-end-line="46" selection-end-column="0" />
60 66 <folding />
61 67 </state>
... ... @@ -195,7 +201,7 @@
195 201 </packageJsonPaths>
196 202 </component>
197 203 <component name="PhpWorkspaceProjectConfiguration" backward_compatibility_performed="true" />
198   - <component name="ProjectFrameBounds" fullScreen="true">
  204 + <component name="ProjectFrameBounds">
199 205 <option name="x" value="1360" />
200 206 <option name="y" value="23" />
201 207 <option name="width" value="80" />
... ... @@ -292,18 +298,18 @@
292 298 <workItem from="1538934478875" duration="76000" />
293 299 <workItem from="1540900056741" duration="8173000" />
294 300 <workItem from="1540976986771" duration="7543000" />
295   - <workItem from="1540993198725" duration="335000" />
  301 + <workItem from="1540993198725" duration="534000" />
296 302 </task>
297 303 <servers />
298 304 </component>
299 305 <component name="TimeTrackingManager">
300   - <option name="totallyTimeSpent" value="33515000" />
  306 + <option name="totallyTimeSpent" value="33714000" />
301 307 </component>
302 308 <component name="ToolWindowManager">
303   - <frame x="0" y="0" width="1440" height="900" extended-state="0" />
  309 + <frame x="1360" y="23" width="80" height="22" extended-state="0" />
304 310 <editor active="true" />
305 311 <layout>
306   - <window_info id="Project" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.17195208" sideWeight="0.5" order="0" side_tool="false" content_ui="combo" />
  312 + <window_info id="Project" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="1.0" sideWeight="0.5" order="0" side_tool="false" content_ui="combo" />
307 313 <window_info id="TODO" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="6" side_tool="false" content_ui="tabs" />
308 314 <window_info id="Docker" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="false" weight="0.33" sideWeight="0.5" order="10" side_tool="false" content_ui="tabs" />
309 315 <window_info id="Event Log" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="7" side_tool="true" content_ui="tabs" />
... ... @@ -556,7 +562,7 @@
556 562 </entry>
557 563 <entry file="file://$PROJECT_DIR$/api/routes/routes.js">
558 564 <provider selected="true" editor-type-id="text-editor">
559   - <state relative-caret-position="690">
  565 + <state relative-caret-position="-2677">
560 566 <caret line="46" column="0" lean-forward="false" selection-start-line="46" selection-start-column="0" selection-end-line="46" selection-end-column="0" />
561 567 <folding />
562 568 </state>
... ...