Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Save more on your purchases! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Android Application Programming with OpenCV

You're reading from   Android Application Programming with OpenCV For Java developers OpenCV is a fantastic opportunity to benefit from the popularity of image related mobile apps on Android. This book teaches you all you need to know about computer vision with practical projects.

Arrow left icon
Product type Paperback
Published in Sep 2013
Publisher Packt
ISBN-13 9781849695206
Length 130 pages
Edition 1st Edition
Languages
Tools
Arrow right icon
Author (1):
Arrow left icon
Joseph Howse Joseph Howse
Author Profile Icon Joseph Howse
Joseph Howse
Arrow right icon
View More author details
Toc

Creating menu and string resources


Our app's menus and localizable text are described in XML files. Identifiers in these resource files are referenced by Java code, as we will see later.

Note

For details about Android app resources, see the official documentation at http://developer.android.com/guide/topics/resources/index.html.

First, let's edit res/menu/activity_camera.xml so that it has the following implementation, describing the menu items for CameraActivity:

<menu xmlns:android="http://schemas.android.com/apk/res/android" >
  <item
    android:id="@+id/menu_next_camera"
    android:orderInCategory="100"
    android:showAsAction="ifRoom|withText"
    android:title="@string/menu_next_camera"/>
  <item
    android:id="@+id/menu_take_photo"
    android:orderInCategory="100"
    android:showAsAction="always|withText"
    android:title="@string/menu_take_photo"/>
</menu>

Note that we use the android:showAsAction attribute to make menu items appear in the app's top bar...

You have been reading a chapter from
Android Application Programming with OpenCV
Published in: Sep 2013
Publisher: Packt
ISBN-13: 9781849695206
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image