Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Here are some suggestions.</p> <p>First, pay attention to the new <a href="http://developer.android.com/design/index.html">Android Design guidelines</a>. I believe this is a good idea, not only good for the obvious design reasons, but also because it will make backward compatibility easier. For example, the <a href="http://developer.android.com/sdk/compatibility-library.html">Support Package</a> helps bring recommended design elements to old platforms and new revs of this package will likely bring it into closer alignment with the latest design guidelines.</p> <hr> <p>Second, use <a href="http://developer.android.com/guide/topics/fundamentals/fragments.html">fragments</a>. Even if you don't think you have much need for fragments now, they are the future of Android design and the number of large screen Androids is likely to grow very quickly. And though they add some extra complexity, I think they encourage good design by separating the view from the activity.</p> <p>Enable the use of fragments via the <a href="http://developer.android.com/sdk/compatibility-library.html">Support Package</a> (also known as the compatibility library). This is fairly simple and I have not encountered any problems doing this. Just make sure that your imports look like this:</p> <pre><code>import android.**support.v4**.app.Fragment; </code></pre> <p>so that you are getting them from the support package rather then calling the native ICS API's directly.</p> <hr> <p>Third, enable the ICS/HC actionbar using themes as described in the docs. Note that this does not give your app an actionbar on pre-Honeycomb platforms. For that you either need to use something like <a href="http://actionbarsherlock.com/">ActionBarSherlock</a> or the <a href="http://developer.android.com/resources/samples/ActionBarCompat/index.html">ActionBarCompat</a> sample. Both are good solutions but they add to the complexity of your app. There is no actionbar in the current rev of the support package, and this is apparently due to technical issues, but I would suspect that they are trying to resolve those issues.</p> <p>So, if you want to keep is simple, consider that it is reasonable for your app to have an actionbar on ICS &amp; HC, and no actionbar on earlier platforms. Actually, the <a href="http://android-developers.blogspot.com/">Android Dev blog</a> had a post in the last few days that focussed on managing menus and action items under these circumstances.</p> <p>Also, consider that adding a pre-Honeycomb actionbar to your app later (e.g. using the code from ActionBarCompat sample) won't be that bad - much easier, in my opinion, then reworking your code for fragments later.</p> <p>Finally, note that you will need to use a recent SDK so that you can refer to elements such as the holo theme (for the ICS actionbar) and the <code>showAsAction="ifRoom"</code> element, so your manifest will include something like:</p> <pre><code>&lt;uses-sdk android:minSdkVersion="8" android:targetSdkVersion="15" /&gt; </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload