(Android Studio) (Mobile App Development)
Create a spinner that has drop down function on it (NOT tab view). Place a scroll bar inside the dropdown of the spinner. The categories inside the spinner include: vegetable, fruit, meat, drink. Clicking on each section will pop up a fragment section below. Here, I clicked on the vegetable section, which leads me to a page displaying vegetables and their expiration dates.
Note: Post XML and Java codes for both the main activity and the fragments. You only need to create the vegetable fragment, I code the rest based on the vegetable fragment. Do not screenshot the code, please write out the code.



activity_main.xml
<?xml version ="1.0" encoding =" utf-8"?>
<LinearLayout 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:orientation = "vertical"
android:weightSum = "3"
tools:context = ".MainActivity">
<LinearLayout
android:layout_width ="match_ parent"
android:layout_ height = "0dp"
android:layout_weight = "1"
android: orientation = "vertical"
android: weightSum = "2"
>
<TextView
android:layout_width = "match_ parent"
android: layout_height = "wrap_content"
android: layout_weight = "1"
android: text = "Choose Category"
android: gravity = "center"
android:textStyle ="bold" android:textSize= "20sp"
/>
<Spinner
android:id = " @+id/spinner"
android:layout_width = "match_parent"
android:layout_height = "36dp"
android:layout_weight= "1"/>
</LinearLayout>
<FrameLayout>
android: id = "@+id/myFrame"
android: layout_width = "match_parent"
android:layout_height ="0dp"
android:layout_weight = "2">
</FrameLayout>
</LinearLayout>
MainActivity.java
public class MainActivity extends Activity{
String[] categories = {"choose category","vegetables","fruit","meat","drink"};
private Spinner mSpinner;
private String Select;
private FragmentManager mFragManager; private FragmentTransaction mFragTransaction; private VegiFragment mVegfragment;
private DrinkFragment mDrinkFragment; private Fruit fragment mFruitFragment; private MeatFragment mMeatFragment;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
mVegFragment = new VegiFragment(); mDrinkFragment = new DrinkFragment(): mMeatFragment = new MeatFragment();
mFruitFragment = new FruitFragment():
mSpinner = (Spinner)findViewById(R.id.spinner);
mFragManager = getFragmentManager();
ArrayAdapter<String> dataAdapter = new ArrayAdapter<>(this,android.R.id.simple_spinner_item, categories);
dataAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
mSpinner.setAdapter( dataAdapter);
mSpinner.setOnItemSelectedListener(
new AdapterView.OnItemSelectedListner(){
@Override
public void onItmeSelected( AdapterView<?> arg0, View arg1, int arg2, long arg3){
int position = mSpinner.getSelectedItemPosition();
Select = categories [+position];
if( Select == "vegetables"){
if(mFragManager.findFragmentById(R.id.myFrame)== null){
mFragTransaction = mFragManager.beginTransaction();
mFragTransaction.add(R.id.myFrame, mVegFragment);
mFragTransaction.commit();
}
if(mMeatFragment.isResumed()||mDrinkFragment.isResumed()||mFruitFragment.isResumed()){
mFragTransaction = mFragManager.beginTransaction();
mFragTransaction.replace(R.id.myFrame,mmVegFragment);
mFragmentTransaction.commit();}}
if(Select == "meat"){
mFragTransaction = mFragManager.beginTransaction();
if(mVegFragment.isResumed()||mFruitFragment.isResumed()||mDrinkFragment.isResumed()){
mFragTransaction.replace(R.id.myFrame, mMeatFragment);}
mFragmentTransaction.commit();}
// Do same for fruit and drink
}
}
@Override
public void on nothing selected(AdapterView<?> arg0){});
}}









(Android Studio) (Mobile App Development) Create a spinner that has drop down function on it (NOT...
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 Studio)
Create a camera app that allows the user to upload a picture
from their phone camera gallery, see the picture via summary page,
and edit the picture as well. Clicking on "Insert picture here from
camera photo gallery" in the add page will allow the user to upload
a picture from their existing camera photo gallery on their phone.
The user can choose where to save the picture, starting with
Picture 1-5. Once they choose where to save...
• Create an Android Stop Watch mobile application based on the below requirements: ◦ The Stop Watch App will display the time as: ▪ HH:MM:SS.mmmm Where HH represents the number of hours; MM represents the number of minutes; SS represents the number of seconds; mmmm represents the number of milliseconds. For example, ▪ 02:09:57.1234 The above time example would read: ▪ Two hours and ▪ Nine minutes and ▪ Fifty seconds and ▪ One thousands two hundreds thirty four milliseconds...
If anyone here is a Java and Android Studio expert please I really need help fulfilling the requirements needed to make a Rock Paper Scissors game. I mainly need Java code to complete it I will post what I have so far I don't have much time left please if anyone can help me I would really appreciate it. Here's what the app is supposed to do... The player should be able to select either Rock, Paper, or Scissors.The app...