BiRent application
Android 7
Google Maps SDK
Spring Boot
Welcome page
First page after application start
Buttons for Sign In and Sign Up

Sign In
Sign Up


Main Page
Map with all the bikes around your location
List of all rental offers
Settings button
Menu button

Menu bar
Panel for navigation in application
Browse bikes
list of offers (home page)
Payment methods
work with bank cards
My Garage
bike and user settings

Application UI/UX
Made with Android layouts XML files.
Each screen represents an XML layout with set of components
<?xml version="1.0" encoding="utf-8"?>
<android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/drawer_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true"
tools:openDrawer="start">
<include
layout="@layout/app_bar_main"
android:layout_width="match_parent"
android:layout_height="match_parent" />
<android.support.design.widget.NavigationView
android:id="@+id/nav_view"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_gravity="start"
android:fitsSystemWindows="true"
android:theme="@style/AppTheme"
app:headerLayout="@layout/nav_header_main"
app:menu="@menu/activity_main_drawer" />
</android.support.v4.widget.DrawerLayout>
Application Logic
All the application logic made with Java and native Android libraries
public class WelcomeActivity extends AppCompatActivity implements SurfaceHolder.Callback {
private MediaPlayer mp = null;
SurfaceView mSurfaceView = null;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_welcome);
mp = new MediaPlayer();
mSurfaceView = (SurfaceView) findViewById(R.id.surface1);
mSurfaceView.getHolder().addCallback(this);
}
@Override
public void surfaceCreated(SurfaceHolder holder) {
Uri video = Uri.parse("android.resource://" + getPackageName() + "/"
+ R.raw.welcome_page);
try {
mp.setDataSource(this, video);
mp.prepare();
} catch (IOException e) {
e.printStackTrace();
}
//Get the dimensions of the video
int videoWidth = mp.getVideoWidth();
int videoHeight = mp.getVideoHeight() + 50;
//Get the width of the screen
int screenWidth = getWindowManager().getDefaultDisplay().getWidth();
//Get the SurfaceView layout parameters
android.view.ViewGroup.LayoutParams lp = mSurfaceView.getLayoutParams();
//Set the width of the SurfaceView to the width of the screen
lp.width = screenWidth;
//Set the height of the SurfaceView to match the aspect ratio of the video
//be sure to cast these as floats otherwise the calculation will likely be 0
lp.height = (int) (((float) videoHeight / (float) videoWidth) * (float) screenWidth);
//Commit the layout parameters
mSurfaceView.setLayoutParams(lp);
//Set video looping
mp.setLooping(true);
//Start video
mp.setDisplay(holder);
mp.start();
Log.d("surfaceCreated", "surfaceMGT");
}
@Override
public void surfaceChanged(SurfaceHolder holder, int format, int width, int height) {
Log.d("surfaceChanged", "surfaceMGT");
}
@Override
public void surfaceDestroyed(SurfaceHolder holder) {
Log.d("surfaceDestroyed", "surfaceMGT");
}
public void logInButtonClick(View view) {
Intent i = new Intent(WelcomeActivity.this, LoginActivity.class);
startActivity(i);
}
public void signUpButtonClick(View view) {
Intent i = new Intent(WelcomeActivity.this, SignUpActivity.class);
startActivity(i);
}
}
Application Data (API)
Application will use set of REST API services written with a Spring Boot, that will make API development easy to use.
package hello;
import org.springframework.boot.*;
import org.springframework.boot.autoconfigure.*;
import org.springframework.stereotype.*;
import org.springframework.web.bind.annotation.*;
@Controller
@EnableAutoConfiguration
public class SampleController {
@RequestMapping("/")
@ResponseBody
String home() {
return "Hello World!";
}
public static void main(String[] args) throws Exception {
SpringApplication.run(SampleController.class, args);
}
}
Application Data (DB)
REST API will communicate with a set of highly-available PostgerSQL databases that will store all the data.

end
BiRent application
By Dima Havrylevych
BiRent application
- 868