Creating logout and translate activity - lakshmanamettu/cs5551_team12_icp GitHub Wiki
https://github.com/lakshmanamettu/cs5551_team12_icp/tree/master/ICP4/Source
Source code:For creating Application To logout from translate activity to home page as well as, To change user text from required language to another language.
Snippets of code and output
output-1
output-1 corresponds to creating home page having username and password.
output-2
output-2 corresponds to giving username and password and go to translate page.Here my user name and password both is lak.
output-3
output-3 shows that different types of languages through drop-down menu in both cases i.e input side and output side along with logout button located at the top of the translate page.
output-4
output-4 shows that an example for converting text from english to telugu.
translate page-1
Above translate page-1 having code for creating logout button which is used to get back from translate page to home page through start an activity i.e using intent class.This code redirects from login page to the home page.Also above one shows creating logout button in xml file.
translate page-2
In translate-2 page I am using map,m1 class,string array for getting different languages.Spinner allows you to select an item from a drop down menu.It contains API to convert source text from one language to another language.
Translate activity
Above one shows that having logout button similar in both cases i.e match parent property.
String array for converting source text from one to another language
Above page having code containing string array for different languages along with array name as country array and app name as translate activity.
Bonus Questions Answers
1.Differentiate –Linear, Framed, Relative & Constrained layouts.
In Linear layout, children containers are organised in linear or vertical fashion. In Relative layout, Tracing of children containers easy.Like tree structure. In Framed layouts, to load child one above another, like cards inside a frame, we can place one above another or anywhere inside the frame. In Constrained layouts, is similar to a Relative Layout in that it uses relations to position and size widgets, but has additional flexibility and is easier to use in the Layout Editor.
2.Differentiate –implicit and explicit intent.
Explicit intents are used to call application activity whereas implicit intents are used to call system level activity to choose the target.
3.Do the android apps have main() –Justify your answer in either case.
There is no need of main() for android apps, In the case of Android, the Dalvik Virtual Machine is designed to find a class which is a subclass of Activity and which is set as a LAUNCHER to start the execution of the application from its onCreate() method, so there is no need of a main() method