To open your
app just click on the app name(AndroididToast) on the left menu; then browse to, the androidmanifest.xml file at bottom of files, double click to open it. The file now shows in the
AIDE coding editor.
To view A FILE do either: from right menu choose FILES or GOTO, this will show the apps files along the top of editor, dropdown, and left
side menu. After editing a file, SAVE it, right side menu, choose SAVE.
Just double click a file to open it in the coding editor. Once file is opened they also show as tabs at top of editor. Just click file name to open it in the code editor.
To return to prev folder, just click on ORANGE colored FOLDER at top of files hierachy left side menu; to return to AppProjects (where you can see all apps you created) just click orange folder
till you see AppProject, or from dropdown menu right side, or middle editor, choose, Show - View All Projects.
To build your app choose the arrow at top of AIDE editor; older version select right side menu (dots) from selections,Choose RUN.
Code the Strings.xml
We will add one line of text
"Use Toast Method To Display Text". We will name our string, learntoast, and
type the text as shown.
Our strings.xml file also has another string, our app_name,AndroididToast, which we will leave in the strings.xml as this is the name
that shows at top of view and is required.
Once the text is added to the strings.xml file, save the file.
We will make reference to our string in our TextView element as shown here.
The duration of the toast message(time it remains visible in the view) is coded with one of two attribute values; either the Long which we used, and the other value you can use is Short.
You can also have the Toast Message appear anywhere within your app's view, by addng some additional code to our
Toast code.
Learn about coding these and additional Reading on 'Toasts", at the Android Developer website.
View Toasts Code At Android Developer Website
COPY/PASTE CODE
You can get the code from this tutorial from our EXAMPLE CODE section on this page. You can add the code easily to your apps coded pages using copy/paste. Just delete the code that's in your main.xml, MainActivity.java, and strings.xml files and replace it with the code from this tutorial. Save each page after pasting the code.
We also included the androidmanifest.xml file, however, this page only needs to be
coded when adding certain functionalites or themes to your app. For this tutorial
we did not need to change or add code to it.
Once a file is in the editor, you can edit, save it, then RUN your APP, install,
Open your app.
Make sure you SAVED EACH PAGE, before you RUN your code. SAVE, RUN, INSTALL, OPEN, your AndroididToast App. Once it has been
installed on your tablet, you can open it Simply by Clicking on the Android little green App Icon,with the wording 'AndroididToast' on your tablet. It will
be with your other installed apps.
If you make further changes to this App, you need to SAVE, RUN, UPDATE, INSTALL, OPEN the app.
This free script provided by
JavaScript
Kit