Question

In: Computer Science

For this IP, you will create a very simple drawing app using Android Studio. The purpose...

For this IP, you will create a very simple drawing app using Android Studio. The purpose of this assignment is to give you more building blocks to use when programming apps. For full credit for this assignment, you should complete the following: Create a menu and display menu items on the app bar Detect when the user touches the screen and moves a finger Be able to change the color and width of a line Be able to save an image To turn in this assignment, upload screenshots of the working app (from the emulator) as a Word document. The screenshots need to show that the app works and that all of the parts listed work. At a minimum, students should upload 2 screenshots showing: A drawing Menu showing the different color choices and line widths.

Solutions

Expert Solution

Menus:-

Menus are a common user interface component in many types of applications. To provide a familiar and consistent user experience, you should use the Menu
APIs to present user actions and other options in your activities.

Beginning with Android 3.0 (API level 11), Android-powered devices are no longer required to provide a dedicated Menu button. With this change, Android
apps should migrate away from a dependence on the traditional 6-item menu panel and instead provide an app bar to present common user actions.

Although the design and user experience for some menu items have changed, the semantics to define a set of actions and options is still based on the Menu APIs.
This guide shows how to create the three fundamental types of menus or action presentations on all versions of Android:

Options menu and app bar:-
The options menu is the primary collection of menu items for an activity. It's where you should place actions that have a global impact on the app, such as
"Search," "Compose email," and "Settings."
Context menu and contextual action mode:-
A context menu is a floating menu that appears when the user performs a long-click on an element. It provides actions that affect the selected content or context
frame.
The contextual action mode displays action items that affect the selected content in a bar at the top of the screen and allows the user to select multiple items.
Popup menu:-
A popup menu displays a list of items in a vertical list that's anchored to the view that invoked the menu. It's good for providing an overflow of actions that
relate to specific content or to provide options for a second part of a command. Actions in a popup menu should not directly affect the corresponding content—
that's what contextual actions are for. Rather, the popup menu is for extended actions that relate to regions of content in your activity.

To define the menu, create an XML file inside your project's res/menu/ directory and build the menu with the following elements:

<menu>
Defines a Menu, which is a container for menu items. A <menu> element must be the root node for the file and can hold one or more <item> and <group>
elements.
<item>
Creates a MenuItem, which represents a single item in a menu. This element may contain a nested <menu> element in order to create a submenu.
<group>
An optional, invisible container for <item> elements. It allows you to categorize menu items so they share properties such as active state and visibility. For
more information, see the section about Creating Menu Groups.
Here's an example menu named game_menu.xml:

<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android">
<item android:id="@+id/new_game"
android:icon="@drawable/ic_new_game"
android:title="@string/new_game"
android:showAsAction="ifRoom"/>
<item android:id="@+id/help"
android:icon="@drawable/ic_help"
android:title="@string/help" />
</menu>
The <item> element supports several attributes you can use to define an item's appearance and behavior. The items in the above menu include the following
attributes:-

android:id
A resource ID that's unique to the item, which allows the application to recognize the item when the user selects it.
android:icon
A reference to a drawable to use as the item's icon.
android:title
A reference to a string to use as the item's title.
android:showAsAction
Specifies when and how this item should appear as an action item in the app bar.
These are the most important attributes you should use, but there are many more available. For information about all the supported attributes, see the Menu
Resource document.

You can add a submenu to an item in any menu by adding a <menu> element as the child of an <item>. Submenus are useful when your application has a lot of
functions that can be organized into topics, like items in a PC application's menu bar (File, Edit, View, etc.). For example:

<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android">
<item android:id="@+id/file"
android:title="@string/file" >
<!-- "file" submenu -->
<menu>
<item android:id="@+id/create_new"
android:title="@string/create_new" />
<item android:id="@+id/open"
android:title="@string/open" />
</menu>
</item>
</menu>
To use the menu in your activity, you need to inflate the menu resource (convert the XML resource into a programmable object) using MenuInflater.inflate(). In
the following sections, you'll see how to inflate a menu for each menu type.

To specify the options menu for an activity, override onCreateOptionsMenu() (fragments provide their own onCreateOptionsMenu() callback). In this method,
you can inflate your menu resource (defined in XML) into the Menu provided in the callback. For example:

JAVA
@Override
public boolean onCreateOptionsMenu(Menu menu) {
MenuInflater inflater = getMenuInflater();
inflater.inflate(R.menu.game_menu, menu);
return true;
}

Handling click events:-

When the user selects an item from the options menu (including action items in the app bar), the system calls your activity's onOptionsItemSelected() method.
This method passes the MenuItem selected. You can identify the item by calling getItemId(), which returns the unique ID for the menu item (defined by the
android:id attribute in the menu resource or with an integer given to the add() method). You can match this ID against known menu items to perform the
appropriate action. For example:

JAVA
@Override
public boolean onOptionsItemSelected(MenuItem item) {
// Handle item selection
switch (item.getItemId()) {
case R.id.new_game:
newGame();
return true;
case R.id.help:
showHelp();
return true;
default:
return super.onOptionsItemSelected(item);
}
}
When you successfully handle a menu item, return true. If you don't handle the menu item, you should call the superclass implementation of
onOptionsItemSelected() (the default implementation returns false).

If your activity includes fragments, the system first calls onOptionsItemSelected() for the activity then for each fragment (in the order each fragment was added)
until one returns true or all fragments have been called.

Changing menu items at runtime:-

After the system calls onCreateOptionsMenu(), it retains an instance of the Menu you populate and will not call onCreateOptionsMenu() again unless the menu
is invalidated for some reason. However, you should use onCreateOptionsMenu() only to create the initial menu state and not to make changes during the
activity lifecycle.

If you want to modify the options menu based on events that occur during the activity lifecycle, you can do so in the onPrepareOptionsMenu() method. This
method passes you the Menu object as it currently exists so you can modify it, such as add, remove, or disable items. (Fragments also provide an
onPrepareOptionsMenu() callback.)

Creating a floating context menu:-

To provide a floating context menu:-

Register the View to which the context menu should be associated by calling registerForContextMenu() and pass it the View.
If your activity uses a ListView or GridView and you want each item to provide the same context menu, register all items for a context menu by passing the
ListView or GridView to registerForContextMenu().
Implement the onCreateContextMenu() method in your Activity or Fragment.
When the registered view receives a long-click event, the system calls your onCreateContextMenu() method. This is where you define the menu items, usually
by inflating a menu resource. For example:

JAVA
@Override
public void onCreateContextMenu(ContextMenu menu, View v,
ContextMenuInfo menuInfo) {
super.onCreateContextMenu(menu, v, menuInfo);
MenuInflater inflater = getMenuInflater();
inflater.inflate(R.menu.context_menu, menu);
}

MenuInflater allows you to inflate the context menu from a menu resource. The callback method parameters include the View that the user selected and a
ContextMenu.ContextMenuInfo object that provides additional information about the item selected. If your activity has several views that each provide a
different context menu, you might use these parameters to determine which context menu to inflate.

Implement onContextItemSelected().
When the user selects a menu item, the system calls this method so you can perform the appropriate action. For example:

JAVA
@Override
public boolean onContextItemSelected(MenuItem item) {
AdapterContextMenuInfo info = (AdapterContextMenuInfo) item.getMenuInfo();
switch (item.getItemId()) {
case R.id.edit:
editNote(info.id);
return true;
case R.id.delete:
deleteNote(info.id);
return true;
default:
return super.onContextItemSelected(item);
}
}

Enabling batch contextual actions in a ListView or GridView:-

If you have a collection of items in a ListView or GridView (or another extension of AbsListView) and want to allow users to perform batch actions, you
should:

Implement the AbsListView.MultiChoiceModeListener interface and set it for the view group with setMultiChoiceModeListener(). In the listener's callback
methods, you can specify the actions for the contextual action bar, respond to click events on action items, and handle other callbacks inherited from the
ActionMode.Callback interface.
Call setChoiceMode() with the CHOICE_MODE_MULTIPLE_MODAL argument.
For example:
JAVA
ListView listView = getListView();
listView.setChoiceMode(ListView.CHOICE_MODE_MULTIPLE_MODAL);
listView.setMultiChoiceModeListener(new MultiChoiceModeListener() {

@Override
public void onItemCheckedStateChanged(ActionMode mode, int position,
long id, boolean checked) {
// Here you can do something when items are selected/de-selected,
// such as update the title in the CAB
}

@Override
public boolean onActionItemClicked(ActionMode mode, MenuItem item) {
// Respond to clicks on the actions in the CAB
switch (item.getItemId()) {
case R.id.menu_delete:
deleteSelectedItems();
mode.finish(); // Action picked, so close the CAB
return true;
default:
return false;
}
}

@Override
public boolean onCreateActionMode(ActionMode mode, Menu menu) {
// Inflate the menu for the CAB
MenuInflater inflater = mode.getMenuInflater();
inflater.inflate(R.menu.context, menu);
return true;
}

@Override
public void onDestroyActionMode(ActionMode mode) {
// Here you can make any necessary updates to the activity when
// the CAB is removed. By default, selected items are deselected/unchecked.
}

@Override
public boolean onPrepareActionMode(ActionMode mode, Menu menu) {
// Here you can perform updates to the CAB due to
// an <code><a href="/reference/android/view/ActionMode.html#invalidate()">invalidate()</a></code> request
return false;
}
});

Creating a Popup Menu:-
If you define your menu in XML, here's how you can show the popup menu:-

Instantiate a PopupMenu with its constructor, which takes the current application Context and the View to which the menu should be anchored.
Use MenuInflater to inflate your menu resource into the Menu object returned by PopupMenu.getMenu().
Call PopupMenu.show().
For example, here's a button with the android:onClick attribute that shows a popup menu:

<ImageButton
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/ic_overflow_holo_dark"
android:contentDescription="@string/descr_overflow_button"
android:onClick="showPopup" />

The activity can then show the popup menu like this:-
JAVA
public void showPopup(View v) {
PopupMenu popup = new PopupMenu(this, v);
MenuInflater inflater = popup.getMenuInflater();
inflater.inflate(R.menu.actions, popup.getMenu());
popup.show();
}
In API level 14 and higher, you can combine the two lines that inflate the menu with PopupMenu.inflate().

The menu is dismissed when the user selects an item or touches outside the menu area. You can listen for the dismiss event using
PopupMenu.OnDismissListener.

Handling click events:-

To perform an action when the user selects a menu item, you must implement the PopupMenu.OnMenuItemClickListener interface and register it with your
PopupMenu by calling setOnMenuItemclickListener(). When the user selects an item, the system calls the onMenuItemClick() callback in your interface.

For example:

JAVA
public void showMenu(View v) {
PopupMenu popup = new PopupMenu(this, v);

// This activity implements OnMenuItemClickListener
popup.setOnMenuItemClickListener(this);
popup.inflate(R.menu.actions);
popup.show();
}

@Override
public boolean onMenuItemClick(MenuItem item) {
switch (item.getItemId()) {
case R.id.archive:
archive(item);
return true;
case R.id.delete:
delete(item);
return true;
default:
return false;
}
}


@Override
public boolean onCreateOptionsMenu(Menu menu){
super.onCreateOptionsMenu(menu);

// Create an Intent that describes the requirements to fulfill, to be included
// in our menu. The offering app must include a category value of Intent.CATEGORY_ALTERNATIVE.
Intent intent = new Intent(null, dataUri);
intent.addCategory(Intent.CATEGORY_ALTERNATIVE);

// Search and populate the menu with acceptable offering applications.
menu.addIntentOptions(
R.id.intent_group, // Menu group to which new items will be added
0, // Unique item ID (none)
0, // Order for the items (none)
this.getComponentName(), // The current activity name
null, // Specific items to place first (none)
intent, // Intent created above that describes our requirements
0, // Additional flags to control items (none)
null); // Array of MenuItems that correlate to specific items (none)

return true;
}
For each activity found that provides an intent filter matching the intent defined, a menu item is added, using the value in the intent filter's android:label as the
menu item title and the application icon as the menu item icon. The addIntentOptions() method returns the number of menu items added.

Allowing your activity to be added to other menus

You can also offer the services of your activity to other applications, so your application can be included in the menu of others (reverse the roles described
above).

To be included in other application menus, you need to define an intent filter as usual, but be sure to include the CATEGORY_ALTERNATIVE and/or
CATEGORY_SELECTED_ALTERNATIVE values for the intent filter category. For example:

<intent-filter label="@string/resize_image">
...
<category android:name="android.intent.category.ALTERNATIVE" />
<category android:name="android.intent.category.SELECTED_ALTERNATIVE" />
...
</intent-filter>

___________________________________________________________________________

Track touch and pointer movements:-

A new onTouchEvent() is triggered with an ACTION_MOVE event whenever the current touch contact position, pressure, or size changes. As described in
Detecting Common Gestures, all of these events are recorded in the MotionEvent parameter of onTouchEvent().

Because finger-based touch isn't always the most precise form of interaction, detecting touch events is often based more on movement than on simple contact.
To help apps distinguish between movement-based gestures (such as a swipe) and non-movement gestures (such as a single tap), Android includes the notion of
"touch slop". Touch slop refers to the distance in pixels a user's touch can wander before the gesture is interpreted as a movement-based gesture. For more
discussion of this topic, see Managing Touch Events in a ViewGroup.

There are several different ways to track movement in a gesture, depending on the needs of your application. For example:

The starting and ending position of a pointer (for example, move an on-screen object from point A to point B).
The direction the pointer is traveling in, as determined by the x and y coordinates.
History. You can find the size of a gesture's history by calling the MotionEvent method getHistorySize(). You can then obtain the positions, sizes, time, and
pressures of each of the historical events by using the motion event's getHistorical<Value> methods. History is useful when rendering a trail of the user's finger,
such as for touch drawing. See the MotionEvent reference for details.
The velocity of the pointer as it moves across the touch screen.
Refer to the following related resources:

Input Events API Guide
Sensors Overview
Making the View Interactive
Track velocity

You could have a movement-based gesture that is simply based on the distance and/or direction the pointer traveled. But velocity often is a determining factor in
tracking a gesture's characteristics or even deciding whether the gesture occurred. To make velocity calculation easier, Android provides the VelocityTracker
class. VelocityTracker helps you track the velocity of touch events. This is useful for gestures in which velocity is part of the criteria for the gesture, such as a
fling.

Here is a simple example that illustrates the purpose of the methods in the VelocityTracker API:
JAVA
public class MainActivity extends Activity {
private static final String DEBUG_TAG = "Velocity";
...
private VelocityTracker mVelocityTracker = null;
@Override
public boolean onTouchEvent(MotionEvent event) {
int index = event.getActionIndex();
int action = event.getActionMasked();
int pointerId = event.getPointerId(index);

switch(action) {
case MotionEvent.ACTION_DOWN:
if(mVelocityTracker == null) {
// Retrieve a new VelocityTracker object to watch the
// velocity of a motion.
mVelocityTracker = VelocityTracker.obtain();
}
else {
// Reset the velocity tracker back to its initial state.
mVelocityTracker.clear();
}
// Add a user's movement to the tracker.
mVelocityTracker.addMovement(event);
break;
case MotionEvent.ACTION_MOVE:
mVelocityTracker.addMovement(event);
// When you want to determine the velocity, call
// computeCurrentVelocity(). Then call getXVelocity()
// and getYVelocity() to retrieve the velocity for each pointer ID.
mVelocityTracker.computeCurrentVelocity(1000);
// Log velocity of pixels per second
// Best practice to use VelocityTrackerCompat where possible.
Log.d("", "X velocity: " + mVelocityTracker.getXVelocity(pointerId));
Log.d("", "Y velocity: " + mVelocityTracker.getYVelocity(pointerId));
break;
case MotionEvent.ACTION_UP:
case MotionEvent.ACTION_CANCEL:
// Return a VelocityTracker object back to be re-used by others.
mVelocityTracker.recycle();
break;
}
return true;
}
}
Note: You should calculate velocity after an ACTION_MOVE event, not after ACTION_UP. After an ACTION_UP, the X and Y velocities will be 0.
Use pointer capture

Some apps, such as games, remote desktop, and virtualization clients, greatly benefit from getting control over the mouse pointer. Pointer capture is a feature
available in Android 8.0 (API level 26) and later that provides such control by delivering all mouse events to a focused view in your app.

Request pointer capture:-

A view in your app can request pointer capture only when the view hierarchy that contains it has focus. For this reason, you should request pointer capture when
there's a specific user action on the view, such as during an onClick() event, or in the onWindowFocusChanged() event handler of your activity.

To request pointer capture, call the requestPointerCapture() method on the view. The following code example shows how to request pointer capture when the
user clicks a view:

JAVA
@Override
public void onClick(View view) {
view.requestPointerCapture();
}
Once the request to capture the pointer is successful, Android calls onPointerCaptureChange(true). The system delivers the mouse events to the focused view in
your app as long as it's in the same view hierarchy as the view that requested the capture. Other apps stop receiving mouse events until the capture is released,
including ACTION_OUTSIDE events. Android delivers pointer events from sources other than the mouse normally, but the mouse pointer is not visible
anymore.

Handle captured pointer events:-

Once a view has successfully acquired the pointer capture, Android starts delivering the mouse events. Your focused view can handle the events by performing
one of the following tasks:

If you're using a custom view, override onCapturedPointerEvent(MotionEvent).
Otherwise, register an OnCapturedPointerListener.
The following code example shows how to implement onCapturedPointerEvent(MotionEvent):

JAVA
@Override
public boolean onCapturedPointerEvent(MotionEvent motionEvent) {
// Get the coordinates required by your app
float verticalOffset = motionEvent.getY();
// Use the coordinates to update your view and return true if the event was
// successfully processed
return true;
}
The following code example shows how to register an OnCapturedPointerListener:-

JAVA
myView.setOnCapturedPointerListener(new View.OnCapturedPointerListener() {
@Override
public boolean onCapturedPointer (View view, MotionEvent motionEvent) {
// Get the coordinates required by your app
float horizontalOffset = motionEvent.getX();
// Use the coordinates to update your view and return true if the event was
// successfully processed
return true;
}
});
Whether you use a custom view or register a listener, your view receives a MotionEvent with pointer coordinates that specify relative movements such as X/Y
deltas, similar to the coordinates delivered by a trackball device. You can retrieve the coordinates by using getX() and getY().

Release pointer capture:-

The view in your app can release the pointer capture by calling releasePointerCapture(), as shown in the following code example:
JAVA
@Override
public void onClick(View view) {
view.releasePointerCapture();
}
The system can take the capture away from the view without you explicitly calling releasePointerCapture(), most commonly because the view hierarchy that
contains the view that requested capture has lost focus.

_____________________________________________________________

All we have to do to set text color in XML is to add one more attribute called android:textColor to TextView tag. As its value we could put #RGB, #ARGB,
#RRGGBB, #AARRGGBB color value or reference to color saved in colors.xml . For instance RGB red color value is #F00.
This is a code example:-
<TextView
android:id="@+id/this_is_id_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/my_best_text"
android:textColor="#F00"
/>

Instead of putting RGB values into a code you could refer to color resources.
android:textColor="@color/blue"
Of course first you have to add color description to colors.xml file.

From the previous lesson we know how to display a text on Android device’s screens both using XML layout files and Java code. Now it’s time to format that
text. We start with font and background colors, but beside a standard text color there are also other options, like links, highlight and hint colors. Moreover we
would check current colors.

Colors in Android are defined in RGB format. Colors defined by user could be stored in colors.xml resource file. Read our Everything about colors in Android
appendix to understand how to define colors. In this lesson we just focus on using colors, not defining them.

Step 1. Set a text color in XML and Java – android:textColor and setTextColor()

All we have to do to set text color in XML is to add one more attribute called android:textColor to TextView tag. As its value we could put #RGB, #ARGB,
#RRGGBB, #AARRGGBB color value or reference to color saved in colors.xml (all is explained in the appendix). For instance RGB red color value is #F00.

This is a code example:


<TextView
android:id="@+id/this_is_id_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/my_best_text"
android:textColor="#F00"
/>
What’s very convenient in Android Studio it shows colors on the left margin next to the code. Of course you have also live preview for layout created in XML
files.
What’s very convenient in Android Studio it shows colors on the left margin next to the code. Of course you have also live preview for layout created in XML
files.

Instead of putting RGB values into a code you could refer to color resources.


android:textColor="@color/blue"
Of course first you have to add color description to colors.xml file.

In colors.xml file you could give your own names to colors and then use them in XML or Java code.
In colors.xml file you could give your own names to colors and then use them in XML or Java code.

In Java you have to find TextView (as described in previous lesson) and then use setTextColor() method. As an argument we give a color, but we could do it in
many different ways.

This is a sample code:-
@Override
protected void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
TextView textElement = (TextView) findViewById(R.id.this_is_id_name);
textElement.setTextColor(0xFF00FF00); //this is green color
}
To see the effect we have to use emulator or real device.

Remember that referring to colors.xml resources in Java you have to use getResources().getColor(R.color.your_color_name).

There isn’t any dedicated XML tag attribute for just color of background. But we could use android:background.
Now we just focus on colors and this is our XML code with yellow background (this time in #RRGGBB format):


<TextView
android:id="@+id/this_is_id_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/my_best_text"
android:textColor="@color/blue"
android:background="#FFFF00"
/>

In Java all we need is setBackgroundColor() method working in the same way as setTextColor().

This is a code example using Android class Color as a color source (it’s also explained in appendix about colors):

Java:-

textElement.setBackgroundColor(Color.MAGENTA);
_______________________________________________________________

How to Store/Save ImageView image in Gallery in android programmatically.

<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
Code for MainActivity.java file.

package com.saveimageviewimagegallery_android_examples.com;

import android.app.Activity;
import android.graphics.Bitmap;
import android.graphics.drawable.BitmapDrawable;
import android.graphics.drawable.Drawable;
import android.net.Uri;
import android.os.Bundle;
import android.provider.MediaStore;
import android.view.View;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.Toast;

public class MainActivity extends Activity {

ImageView imageview;
Button button;
Drawable drawable;
Bitmap bitmap;
String ImagePath;
Uri URI;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);

button = (Button)findViewById(R.id.button1);
imageview = (ImageView)findViewById(R.id.imageView1);


button.setOnClickListener(new View.OnClickListener() {

@Override
public void onClick(View v) {
// TODO Auto-generated method stub

drawable = getResources().getDrawable(R.drawable.demo_image);

bitmap = ((BitmapDrawable)drawable).getBitmap();

ImagePath = MediaStore.Images.Media.insertImage(
getContentResolver(),
bitmap,
"demo_image",
"demo_image"
);

URI = Uri.parse(ImagePath);

Toast.makeText(MainActivity.this, "Image Saved Successfully", Toast.LENGTH_LONG).show();

}
});

}
}
Code for activity_main.xml layout file.

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
tools:context="com.saveimageviewimagegallery_android_examples.com.MainActivity" >

<ImageView
android:id="@+id/imageView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:src="@drawable/demo_image" />

<Button
android:id="@+id/button1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/imageView1"
android:layout_centerHorizontal="true"
android:layout_marginTop="21dp"
android:text="Click here to Store/Save ImageView image in Gallery in android programmatically" />

</RelativeLayout>
Code for AndroidManifest.xml file.

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.saveimageviewimagegallery_android_examples.com"
android:versionCode="1"
android:versionName="1.0" >

<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="21" />

<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>

<application
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<activity
android:name=".MainActivity"
android:label="@string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />

<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>

</manifest>

______________________________________________________________________________________

Screenshots:-

****PLEASE UPVOTE


Related Solutions

Create a Scorekeeper app in android studio by using java language - Layouts | Widgets Create...
Create a Scorekeeper app in android studio by using java language - Layouts | Widgets Create the layout for your score keeping app. The app should have: Two team names (TextViews) Two scores (TextViews) Buttons to increase/ decrease the scores An amount to change the score by (RadioButtons) You must have at least two score options The scores can be changed by anything you want American football: 1, 2, 3, 6 Basketball: 1, 2, 3 Freestyle wrestling: 1, 2, 3,...
Using Android Studio, create a one java android app that has 4 buttons:- Change Color Button...
Using Android Studio, create a one java android app that has 4 buttons:- Change Color Button - When the Change Color button is clicked, it changes the current activity background to a randomly selected color Speak Button - When the Speak button is clicked, it opens a new activity named SpeakActivity. On the SpeakActivity there are three controls: EditText, Button (Speak) and Button (Back). The Speak button uses the Text to Speech service to say the text entered in EditText....
android studio Begin a new app and create a Java class for products with data: productName,...
android studio Begin a new app and create a Java class for products with data: productName, productCode and price and use a file of objects to store product data and read back and display on screen. Do this by creating a simple form using EditTexts, buttons or ActionBar items and display output using an Alert.
use android studio or MIT inventor Create a Presidents Quiz App for your project with the...
use android studio or MIT inventor Create a Presidents Quiz App for your project with the following requirements: You must have images Buttons Label Conditional Statement Homepage with instructions Sound (music, buzzer, etc.) - Ensure you are using the correct layout: Gravity(Android Studio), Horizontal or Vertical Arrangement (MIT). - 40POINTS Points System (indicating how many answers they got wrong/correct). 20POINT 1-2 questions per President (45+ questions)
Android Programming Create an app called GuessWho. The point of the app will to have the...
Android Programming Create an app called GuessWho. The point of the app will to have the user play a guessing game based on a displayed image. The user will be greeted with a screen that has an image of a person, four buttons and a next button. The four buttons should each have a different name on it. One of the names will be the actual name of the person in the image. Your guess who quiz should consist of...
Android Studio (Java) I'm trying to create a simple calculator. I want to put out a...
Android Studio (Java) I'm trying to create a simple calculator. I want to put out a message if they try to divide by 0. I have this so far. What code should I put? divide.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { if (number1.getText().length() != 0 && number2.getText().length() != 0) { double n1= Double.parseDouble(number1.getText().toString()); double n2= Double.parseDouble(number2.getText().toString()); double res= n1 / n2; result.setText(String.valueOf(res)); } else { Toast.makeText(view.getContext(), "Please enter the numbers properly", Toast.LENGTH_SHORT).show(); } } });
Hi! I need it in android studio and in java Design a game app “BouncingBall ”...
Hi! I need it in android studio and in java Design a game app “BouncingBall ” in which the user’s goal is to prevent a bouncing ball from falling off the bottom of the screen. When the user presses the start button, a ball bounces off the top, left and right sides (the “walls”) of the screen. A horizontal bar on the bottom of the screen serves as a paddle to prevent the ball from hitting the bottom of the...
Hi! I need it in android studio and in java Design a game app “BouncingBall ”...
Hi! I need it in android studio and in java Design a game app “BouncingBall ” in which the user’s goal is to prevent a bouncing ball from falling off the bottom of the screen. When the user presses the start button, a ball bounces off the top, left and right sides (the “walls”) of the screen. A horizontal bar on the bottom of the screen serves as a paddle to prevent the ball from hitting the bottom of the...
Create a mobile application using Android studio, for cinema tickets reservation. The application will be used...
Create a mobile application using Android studio, for cinema tickets reservation. The application will be used by the customers to book cinema tickets. Only users of 15 years old and above are allowed to book cinema tickets for a particular film. The user can book more than one ticket where ticket prices vary between 20 and 50 AED. Your app contains tree Activities. The first activity is a launching activity containing a logo and a button start. When the user...
IN ANDROID STUDIO, you will create a mortgage calculator appthat allows the user to enter...
IN ANDROID STUDIO, you will create a mortgage calculator app that allows the user to enter a purchase price, down-payment amount, and an interest rate.Based on these values, the app should calculate the loan amount (purchase price minus down payment) and display the monthly payment for 10, 20, and 30-year loans.Allow the user to select a custom loan duration (in years) by using a SeekBar and display the monthly payment for that custom loan duration.Assignment deliverables (all in a ZIP...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT