Using Android Studio Java, create a program which has two functions:
Function1: has a text field and a button to invoke "Function 2"
Function 2: process the data entered in the text field on Function 1.
AndroidManifest.xml
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.webcall">
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.CALL_PHONE"/>
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/AppTheme">
<activity android:name=".MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
activity_main.xml
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity">
<EditText
android:id="@+id/parserField"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:layout_marginTop="150dp"
android:layout_marginEnd="8dp"
android:ems="10"
android:hint="Enter URL/Phone Number"
android:inputType="textPersonName"
android:padding="16dp"
android:textAlignment="center"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<Button
android:id="@+id/submitButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="50dp"
android:backgroundTint="@color/colorAccent"
android:padding="16dp"
android:text="Submit"
android:textColor="@android:color/white"
android:textSize="18sp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/parserField" />
</androidx.constraintlayout.widget.ConstraintLayout>
MainActivity.java
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import androidx.appcompat.app.AppCompatActivity;
public class MainActivity extends AppCompatActivity {
private EditText parserField;
private Button submitButton;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
function1();
}
private void function1()
{
parserField = (EditText) findViewById(R.id.parserField);
submitButton = (Button) findViewById(R.id.submitButton);
submitButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
final String text = parserField.getText().toString();
function2(text);
}
});
}
private void function2(String text)
{
String[] data = text.split(":");
String indicator = data[0]; // url or phone
String value = data[1];
switch (indicator)
{
case "url":
{
if (!value.startsWith("http://") && !value.startsWith("https://"))
value = "http://" + value;
Uri url = Uri.parse(value);
Intent browserIntent = new Intent(Intent.ACTION_VIEW, url);
if (browserIntent.resolveActivity(getPackageManager()) != null) {
startActivity(browserIntent);
}
break;
}
case "phone":
{
if(!value.startsWith("tel:"))
value = "tel:" + value.trim();
Uri callNumber = Uri.parse(value);
Intent callerIntent = new Intent(Intent.ACTION_DIAL);
callerIntent.setData(callNumber);
startActivity(callerIntent);
break;
}
}
}
}
**********************************************************************************************************************************************
Using Android Studio Java, create a program which has two functions: Function1: has a text field...
Using java in android studio, I need help in making a text to speech button that reads off of my text view thanks for the help
Android Studio (Java) Develop an android app that contains two fragments displayed on one activity. The bottom fragment contains / displays several rows of individual buttons and each of these buttons resemble a letter of the alphabet such as the first button "A" second button "B" etc.. all the way to Z as well as buttons for the numbers 0 - 9. Once a user clicks a button, the corresponding letter or number button they pressed should display in the...
Use android studio to create a concert ticket mobile application. The app will calculate the total cost of concert tickets. These types of apps make it very easy for consumers to buy tickets via their mobile devices. In this app, the user will select an event, enter data, and the mobile app will conduct data processing by performing mathematical calculations. The mobile app details are below: Mobile Application Title: “Ticket Hub” Overview: Provide an app that will calculate the total...
Android Problem Using JAVA Problem: You need to create an app on Android Studios that allows users to register and login into the system. The focus of this project is for you to create an app with several activities and has data validation. You should have for your app: A welcome screen (splash screen) with your app name and a picture. You should then move to a screen that asks the user for either to log in or to register....
In Java.
Write a GUI contact list application. The program should allow you to input names and phone numbers. You should also be able to input a name and have it display the previously entered phone number. The GUI should look something like the following, although you are welcome to format it in any way that works. This should be a GUI application with a JFrame. The program should contain two arrays of Strings. One array will contain a list...
Call this program StackTester (this will contain the main method). Create three other classes called StackGUI, StackADT, and ArrayStack, respectively (there will be no main method within these classes). In java use a text field to enter a string of words , use a button to initiate the translation of a users string of words to be backwards. Instead of pushing a space (i.e. the space between two words) onto the stack, push the character ‘*’. Use another text field...
C++ Program 1. Create a class named BaseballGame that has fields for two team names and a final score for each team. Include methods to set and get the values for each data field. Your application declares an array of 12 BaseballGame objects. Prompt the user for data for each object, and display all the values. Then pass each object to a method that displays the name of the winning team or “Tie” if the score is a tie. (main.cpp,...
1. Create an app with a button and a text field. Display the current count in the text field (display 0 when the app loads). CODE EACH OF THESE SUB QUESTIONS AS SEPARATE APPS! a. Count up to 20, then automatically start back at 1 (instead of reaching 21). b. Count up by one for each button press for the first 10 presses, then count up by 2 for the next 10 presses, 3 for the next 10, and so...
C++ Visul Studio Create a class named Vehicle. The class has the following five member variables: • Vehicle Name • Vehicle number • Sale Tax • Unit price • Total price Include set (mutator) and get (accessor) functions for each field except the total price field. The set function prompt the user for values for each field. This class also needs a function named computePrice() to compute the total price (quantity times unit price + salesTax) and a function to...
*Use Java to create this program* For this assignment, you will be building a Favorite Songs application. The application should have a list with the items displayed, a textbox for adding new items to the list, and four buttons: Add, Remove, Load, and Save. The Add button takes the contents of the text field (textbox) and adds the item in it to the list. Your code must trim the whitespace in front of or at the end of the input...