This week on the course we learned how to get data from the BBC news stream as the app loads and then cache the data so that it is not being constatly downloaded from the web.
This is quite a complicated process as it involves using an API manager in order to get the data efficiently. We then added this into the list view we made earlier in order to create an automatically updating list of stories with headlines and summaries of text.
This week we added more features to the list we created last week in order to make a scrollable and selectable newsfeed timeline.
In the Main Activity we addded some listeners that display the position of the item and the duration of the click when an item in the array of stories is clicked.
The story activity has been set up to contain information such as the title and summary.
We also had a go at modifying the story view to get different effects on parts of the story. The header here is in blue and the summary is in red.
This week we learned how to make a list view to display a scrollable list of items and create layouts. We also learned about keyboard shortcuts to quicken our workflow methods. CTRL + SPACE gives suggestions on the variable you are typing and documentation for that selection. ALT + ENTER is a quick fix shortcut that can do things like importing missing classes. CTRL + ENTER opens the Generate menu which allows you to override methods or generate getters and setters. CTRL + P shows what parameters a method takes.
Layouts use xml to arrange views on screen, it is very similar to html. App development uses dp (density pixels) for measurement as it scales between different devices.
To display a list we used an array adapter and then added some parameters to this in order to be able to get information from and manipulate the list items later.
The app development company 3 Sided Cube is offering a free Android app development course at University. I was lucky enough to get into the course and I am really excited to get started, although a little apprehensive as I don’t have much development experience.
The first lesson mainly focused on the documentation specific to Android development. Using a native language such as cpp or Java is far more advantageous than using web based technologies such as html 5 as they are far slower and aren’t optimised for the device. We are using Android Studio and programming in Java. Andriod apps are made up of contexts, mainly activities, fragments and layouts.
An activity is a source file that is responsible for interacting with and displaying the UI and UX of an app.
Layouts are made up of views, which is an object that is visible on screen and has a specific pupose, ie a button or a text view.
Layouts are a specific way to lay out views, such as scroll layout or linear.
The first app we made simply had an activity that displayed the text view “Hello World”.