Liten android-app for å se bysykkel-stasjoner i Oslo

Overview

bysykkel-kodeoppgave

Liten android-app for å se bysykkel-stasjoner i Oslo

Bruk av appen

Applikasjonen består av én skjerm med:

  • en liste over bysykkel-stasjoner med navn, antall ledige sykler og antall ledige plasser for tilbakelevering av sykkel
  • en knapp for å oppdatere lista

Oppbygging av koden

  • com.example.cyclebikes
    • MainActivity er applikasjonens eneste aktivitet, og denne setter activity_main.xml som contentView.
    • .model
      • .network inneholder SanntidService og SanntidServiceGenerator.kt. Disse filene bruker retrofit og Moshi for å bygge opp objektet SanntidApi som kobler appen opp mot bysykkel-APIet. I tillegg inneholder den SanntidServiceObject.kt, som består av dataklasser som representerer responsen vi forventer fra APIet.
      • Objects.kt definerer dataklassene Result (inneholder status på API-kall) og Station (representasjon av bysykkel-stasjon slik den skal vises i appen).
      • BindingUtils.kt definerer databindinger for å formattere visning av antall ledige sykler og antall ledige "docks" basert på et Stasjon-objekt.
    • .locator inneholder
      • LocatorViewModel som er view model for dene ene skjermen som applikasjonen består av. Denne bruker SanntidApi-objektet for å hente ned data, og setter dataen sammen til en liste av ´Station´-objekter
      • LocatorRecyclerViewAdapter som tar dataene i view modelen og sørger for at disse kan vises frem i et RecyclerView (se fragment_locator.xml under)
      • LocatorFragment som kobler sammen view, viewModel og adapter, ved å observere lista av stasjoner i view modelen og servere denne til adapteret, når dataene endres.
  • res.layout
    • activity_main.xml er en FragmentContainer som inneholder hele UIet i appen. Den peker videre på fragment_locator.xml
    • fragment_locator.xml inneholder knapp for å oppdatere data, RecyclerView med liste av stasjoner (som igjen inneholder station_item.xml) og en ProgressBar/laste-indikator som LocatorFragment-kontrolleren setter synlig/usynlig basert på status av nettverks-kall.
    • station_item.xml inneholder, for hvert enkelt Stasjon-objekt i lista, et CardView med navn, antall tilgjengelige sykler og antall tilgjengelige plasser for å sette fra seg sykkel

Kjøre applikasjonen

Last ned (og evt pakk ut) koden, naviger til rot-mappen CycleBikes og kjør gradlew assembleDebug for å bygge en .apk-fil. Eventuelt åpne prosjektet i Android Studio og kjør applikasjonen eller bygg APK derfra.

You might also like...
Android Bitcoin market app base on Jetpack Compose and MVI. The app displays current bitcoin market price and history price k-line charts.

compose-bitcoin Android Bitcoin market app base on Jetpack Compose and MVVM & MVI. Features Current bitcoin market price. K-line charts of history pri

App for lesson 8 of the Android App Development in Kotlin course on Udacity
App for lesson 8 of the Android App Development in Kotlin course on Udacity

Connect to the Internet - Mars Real Estate This is the toy app for Lesson 8 of t

Android Camper parking app written in kotlin for assignment 2 of Mobile App Development
Android Camper parking app written in kotlin for assignment 2 of Mobile App Development

Technical Report Splash view Application shows a splash screen when opened. The

Quiz-App - An Android app which have some basic questions
Quiz-App - An Android app which have some basic questions

Quiz-App An Android app which have some basic questions Start page Questions pag

A Task Management and Habit-building App, representating my journey in Android as well as my first Kotlin App. 🤗 ✨
A Task Management and Habit-building App, representating my journey in Android as well as my first Kotlin App. 🤗 ✨

A Task Management and Habit-building App, representating my journey in Android as well as my first Kotlin App. 🤗 ✨

An Android app for Dokuz Eylul University students can make use of multiple school websites in this one app
An Android app for Dokuz Eylul University students can make use of multiple school websites in this one app

An Android app for Dokuz Eylul University students can make use of multiple school websites in this one app

Advanced Android Weather App using MVVM Architecture Sample (ViewModel + LiveData + Kotlin + volley) = Weather App
Advanced Android Weather App using MVVM Architecture Sample (ViewModel + LiveData + Kotlin + volley) = Weather App

Advanced Android Weather App using MVVM Architecture Sample (ViewModel + LiveData + Kotlin + volley) = Weather App Video Weather.-.HD.720p.mov Introdu

Android App to save shares from any app into a file.
Android App to save shares from any app into a file.

Save To… Android App to save shares from any app into a file. Download · Website · Contact About the Project Exporting data from any app into a file m

Owner
Harald Sperre
Developer at NTT DATA Business Solutions.
Harald Sperre
Arjun Naik 1 Apr 16, 2022
Ride-Sharing Uber Lyft Android App - Learn to build a ride-sharing Android Taxi Clone App like Uber, Lyft - Open-Source Project By MindOrks

Ride-Sharing Uber Lyft Android App - Learn to build a ride-sharing Android Taxi Clone App like Uber, Lyft - Open-Source Project By MindOrks

MindOrks 1.2k Dec 29, 2022
Android-basics-kotlin-tip-time-app - Tip Time app from Android Basics in Kotlin

Tip Time Tip Time app from Android Basics in Kotlin at developers.google.com. It

Ramon Lima e Meira 0 Jan 2, 2022
Environmental-Monitoring-Android-App - This Android App is used to monitor environmental parameters data from remote sensors

Environmental-Monitoring-Android-App - This Android App is used to monitor environmental parameters data from remote sensors. Parameters includes but not limited to temperature, humidity, air quality, level of Ionizing radiation, ...

Francisco Pascal Elias TAMBASAFIDY 0 Jan 4, 2022
Library to change Android launcher App Icon and App Name programmatically !

AppIconNameChanger Change Android App launcher Icon and App Name programmatically ! Download Demo APK from HERE Kindly use the following links to use

Prabhakar Thota 587 Dec 29, 2022
HideDroid is an Android app that allows the per-app anonymization of collected personal data according to a privacy level chosen by the user.

HideDroid An Android App for preserving user privacy HideDroid is an Android app that allows the per-app anonymization of collected personal data acco

null 100 Dec 12, 2022
Water tracker app helps you with daily reminder to drink water. This app is just a trial to test and improve my android development skills.

?? About Me I am a self-thaught developer learning web and android development. This app is just a trial to test and improve my android development sk

Sinan Sonmez (Chaush) 28 Dec 17, 2022
Visual Studio App Center Sample App for Android

Visual Studio App Center Sample App for Android The Android application in this repository and its corresponding tutorials will help you quickly and e

Yourhomeplan 1 Oct 13, 2021
Android app for Ribbit, Broker API Reference App

Ribbit Reference Implementation (Android) The reference implementation for designing the Android user interface of a broker-dealer trading application

Alpaca 12 Nov 24, 2022
Android-Java-App - Notepad app with user and password. SQL Lite

DVNote2 App Android-Java-App Notepad app with user and password Application made in Android Studio with Java language and SQLite database. How does it

DViga 1 Nov 6, 2021