The Google Lunar XPRIZE is a $30 million competition for the first privately funded team to send a robot to the moon, travel 500 meters and transmit video, images and data back to the Earth.
Deepana Gandhi from India is leading one such team – Team Indus
16 teams are competing for this Prize Money. Here is a a documentary web series about the people competing for the Google Lunar XPRIZE
In this Article you will learn how to add a Share feature to your App.
This will enable users of your app to share content. For instance a user might want to share an image being displayed on the App, using a Messenger or an Email.
In order to do this you need to add an Action Provider to the Action Bar.
Here are the steps:
1. Add a share action provider to the menu xml file.
2. Specify the content to be passed using an intent in your Activity.
Please refer to the code here
If you want to add Menu Items to the Action Bar then you will have to override two methods in your Activity Class.
- onCreateOptionsMenu – To display Menu
- onOptionsItemSelected – To handle user clicks
Follow the video to understand this better.
You should now be familiar with the Android Themes from the last Article.
Action Bars can be used to add items or shortcuts. Like if the user wants to quickly search for something or add something or even modify the app settings.
Let’s see how you can add such functionality.
There are three primary components which needs to be modified.
1. Menu resource file for the activity.
2. The onCreateOptionsMenu method.
3. The onOptionsItemSelected method.
You can find the menu resource file in the /menu folder. It’s auto generated by the Android Studio when you create a new Project.
The other two methods needs to be overridden in the Activity.
Follow the video to understand how to add this feature. Source code is available here.
Note : For the ThemeDemoApp you need to first remove the v7 dependency, as it creates a conflict when you try to use showAsAction attribute.
Newer versions of Android have additional themes available to applications, and you might want to use these while running on those platforms while still being compatible with older versions. – Android Documentation
Since your app targets devices which run on API level 17 and above you don’t need to provide backward compatibility. You can make use of the new Themes.
Let’s see how.
You are going to change the app so that it uses Theme.Holo.Light by default and switches to Theme.Material.Light if app is running on API level 21.
- Open MainActivity class. Change ActionBarActivity to Activity.
- You will notice there are two style.xml files. One which supports v21 and other for lower versions (default).
Change default style.xml to use the following parent theme – android.Theme.Holo.Light
Change v21 style.xml to use the following parent theme – android.Theme.Material.Light
Follow the video to understand better. Source Code is available here
Here is an interesting talk from Thomas Suarez who has created some cool Apps and has also started an App Club at School, all at the age of 12 years.
In this Video you will learn a quick way to customize your App theme using the inbuilt editor. It let’s you choose different themes as well as change colors.
In the last Article you created a new App ThemeDemoApp. Let’s refer to this App to understand the Theme.
Currently the Activity class extends ActionBarActivity. This class is used in conjunction with Theme.AppCompat themes to add action bar to apps that support API levels b/w 7 and 10. If you use this as the superclass you have to use one of these Themes or your App won’t run.
For now you can refer to the Manifest and style XML files to see how theme is referred to.
Source Code available here
A burka isn’t a cage, if you take off a burka it isn’t freedom. Freedom is in the mind.
Here is a wrap up of great articles I found worth reading from the internet this week
First of a series of conversations with some of the world’s most prominent experts on the global fight for free expression and the role that technology plays on both sides of the struggle.
Read about Shamsia Hassani who prefers the medium of graffiti art (a term no one has heard in Afghanistan before), and often paints over bullet holes.
View at Medium.com
Read Google’s Eric Schmidt exclusive article on how he sees artificial intelligence developing, why it is experiencing such a renaissance and where it will go next.
Read how a principal -Nancy Hanks – met a student she expelled, and it changed her approach to discipline.
In the last lesson you learnt about Android Support Libraries. Time to create a new App to see that in action.
Follow this video to create a new Android Project – ThemeDemoApp