To hide the Title Bar in Android Apps you need to change the android.theme property of the activity in AndroidManifest.xml to “@android:style/Theme.Black.NoTitleBar.Fullscreen”: <activity\ android:name=“.Info”\ android:label=“Info”\ android:screenOrientation=“portrait”\ android:theme=“@android:style/Theme.Black.NoTitleBar.Fullscreen” >\ </activity>
Instead of using the pre-made Android GUI elements you can create your own drawables in XML. There’s some documentation on the Android documentation website, but it is not very detailed. Let’s say you want to create a drawable called “tile”, which works similar to a button, but has a toggle state, that is, it remains in either state until it is clicked again. The first thing you do is create an XML file called “tile.xml” in the “res/drawable” directory: <?xml version=“1.0” encoding=“utf-8”?>\ <selector xmlns:android=“http://schemas.android.com/apk/res/android"> <item android:drawable=“@drawable/tile_pressed” android:state_pressed=“true”/>\ <item android:drawable=“@drawable/tile_pressed” android:state_selected=“true”/>\ <item android:drawable=“@drawable/tile_normal”/>\ </selector> This code refers to two other drawables “tile_pressed” and “tile_normal” that are to be defined soon.
With Android 3 Google has introduced the ActionBar and more or less deprecated the Options Menu. However when you want to support older devices (the majority of existing devices still run Android 2.3) you might want to use the Options Menu. When you implement an Options Menu in an Android App, you run it on a Tablet with Android 4.0 and press the Options button, nothing happens. The only way to make it work is to set the SDK versions in the AndroidManifest.xml in a way the minSdkVersion equals the targetSdkVersion 10 (that is Android 2.3): <uses-sdk\ android:minSdkVersion=“10”\ android:targetSdkVersion=“10” /> With that setting apps will still run the Options Menu code and work on Android 2.3 to 4 (for now).
Navigation between Pages is the predominant application paradigm for Windows Phone apps, when you are not creating a panorama app. Very often you will want to pass data between the individual items, for instance when the user selects an item from a list and the application navigates to a detailed view of that item. There are several solutions to that problem: Define a variable in the static Application object. Use the query string (forward navigation only) Use PhoneApplicationService Use delegates Number 1 is simple.
Suppose you got a List of Strings (any other will work, too) and you want to pick a random element from it. The first thing you do is initialize a new Random object. The you can use the Next() method of the Random object, passing the number of objects in the List as the upper bound: List<String> AllStrings = new List<String>();\ // add elements to List here\ Random rndObj =
Let’s say you have a list of words in a file that is saved as a static resource in your app. Now you want to read each line and append it to a List. The solution is simple: you just use the ReadLine() method in a loop and Add() to a List of Strings. List<String> RandomStrings = new List<String>(); StreamResourceInfo fileres =\ Application.GetResourceStream(new Uri(“strings.txt”, UriKind.Relative));\ using (System.IO.Stream isoFileStream = fileres.Stream)
To remove the title bar you need to set the attribute “shell:SystemTray.IsVisible” to “True” in the respective XAML file such as “Mainpage.xaml”: <phone:PhoneApplicationPage …\ xmlns:shell=\ “clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone”\ shell:SystemTray.IsVisible=“True”>
While Analysts are quick to bash Nokia for missing the rise of the smartphone, there’s quite possibly a return of the feature phone ahead. Nokia is still making a major share of their revenue with their Asha models - although in a possibly neck-breaking move they are trying to cut off their Symbian legacy and bet everything on Windows Phone. On the other hand the smartphone market (at least in Europe and the US) seems to become saturated.