From 7cb05ba4fc72e33decfd4e80544459bd1c8c75a6 Mon Sep 17 00:00:00 2001 From: Sam Hos Date: Tue, 23 Apr 2024 12:24:37 +0200 Subject: [PATCH] appsetup documentation --- docs/documentation/android/appSetup.md | 39 ++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 docs/documentation/android/appSetup.md diff --git a/docs/documentation/android/appSetup.md b/docs/documentation/android/appSetup.md new file mode 100644 index 0000000..f19693d --- /dev/null +++ b/docs/documentation/android/appSetup.md @@ -0,0 +1,39 @@ +# Setting up a android app + +## How to make your project from a empty project + +### Layout +You first need to make the layout of the app. This can be done in the res folder where you can make a android recource file. When you open that file you can drag and drop elements in the layout. + +### Code +Then need to make the main class. The class will probably look like this. + +```java +package com.fitbot.fitbot; + +import android.os.Bundle; +import androidx.appcompat.app.AppCompatActivity; + +public class MainActivity extends AppCompatActivity { + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + // set activity_main to your respective layout file + setContentView(R.layout.activity_main); + } +} +``` + +### Manifest +For the app to be able to build you need to add the activity to the manifest file. You can do this by adding this to the manifest file. + +```xml + + + + + + +``` +The class name that is ran first is defined in the first line of the class. \ No newline at end of file