-
Navigate to the directory where the EventRegistration application resides, e.g., /home/user/git/eventregistration
-
Initialize a new, orphan branch with the following commands
git checkout --orphan android
git reset
rm -rf ./* .gitignore
Note
|
One-liner command that does the same for those who like living dangerously:git checkout --orphan android && git reset && rm -rf ./* .gitignore
|
-
Select a Basic Activity and click Next
-
Specify project details and click on Finish
-
Wait until the project is built by Gradle, this takes a minute or two
-
Optional step.
-
Select the Project view in the left pane (instead of the default Android view) and observe three files:
-
MainActivity.java: application code is written here (located in app/src/main/java)
-
content_main.xml: layout specifications of the UI are provided in XML (located in app/src/main/res/layout)
-
strings.xml: naming of resources (located in app/src/main/res/values)
-
-
Include a dependency for network communication by adding the following line to the
build.gradle
file located in the app folder to the end within thedependencies{ … }
part (see figure, but the content is different).implementation 'com.loopj.android:android-async-http:1.4.9'
-
Open the AndroidManifest.xml file (located in
app/src/main
within the Android project), and add the following XML tag for setting permissions appropriately (before the existing<application>
tag)<?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="ca.mcgill.ecse321.eventregistration"> <uses-permission android:name="android.permission.INTERNET"/> <!-- Existing content with <application> tag --> </manifest>
-
As the gradle build file has changed, click on the Sync link.
-
Re-build the project by Build | Make Project if still needed.