1. Set webView in layout

2. Create Variable WebView and String in java

3. findViewById

4. webView.getSettings().setJavaScriptEnabled(true) : Enable JavaScript

5. webView.loadUrl(url) : Open URL

6. webView.setWebChromeClient(new WebChromeClient()) : Use Chrome, open faster

7. webView.setWebViewClient(new WebViewClientClass()) : We should make WebViewClientClass

 

8. private class WebViewClientClass extends WebViewClient 

Method : public boolean shouldOverrideUrlLoading : read current page's url

 

9. onKeyDown Method : If the user clicks the back button, what function would occur?

onKeyDown(int keyCode, KeyEvent event) : keyCode = entered key

 

Also, we should revise AndroidManifest.xml to show the website, by adding Internet permission.

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

출처 : 홍드로이드 유튜브

'Android' 카테고리의 다른 글

SharedPreferences  (0) 2022.01.31
ListView  (0) 2022.01.31
Package  (0) 2022.01.30
Intent  (0) 2022.01.29
EditText&Button  (0) 2022.01.29

SharedPreferences name = getSharedPreferences(value, mode)

 

ctrl + o : shows overriding classes

 

onDestroy() : When app terminates, this class is called.

 

SharedPreferences Value vanishes when the app is deleted.

 

출처 : hongdriod홍드로이드 Youtube

'Android' 카테고리의 다른 글

Webview  (0) 2022.02.02
ListView  (0) 2022.01.31
Package  (0) 2022.01.30
Intent  (0) 2022.01.29
EditText&Button  (0) 2022.01.29

android:orientation

Set vertical / horizontal view inside layout

 

Listview

1. We should make list type to save data

List<String> data = new ArrayList<>();

 

2. Make Arrayadapter to connect array to listview

ArrayAdapter<String> adapter = new ArrayAdapter<>(this, android.R.layout.listtype, data)

'This' means this activity, android.R.layout.listtype sets list type, data is a Array list.

 

3. Set adapter to list

list.setAdapter(adapter)

'list' should be the name of listview variable.

 

4. Add data

data.add("value");

 

5. Save change

adapter.notifyDataSetChanged();

 

출처 : https://www.youtube.com/playlist?list=PLC51MBz7PMyyyR2l4gGBMFMMUfYmBkZxm

'Android' 카테고리의 다른 글

Webview  (0) 2022.02.02
SharedPreferences  (0) 2022.01.31
Package  (0) 2022.01.30
Intent  (0) 2022.01.29
EditText&Button  (0) 2022.01.29

XML

<Application>

Basic Settings. Icons, label, theme...

<Activity>

All activities should be declared in Activity tab.

LAUNCHER : First activity that runs when app starts

 

Drawable

Pictures used in application

 

Layout

Layout of activities

 

Mipmap

Icons per resolutions

In general, we should classify all icons by screen size so that the layout won't break.

 

Color

Colors' name and value

 

String

String and its name

 

Style

App themes

 

출처 : https://www.youtube.com/playlist?list=PLC51MBz7PMyyyR2l4gGBMFMMUfYmBkZxm

'Android' 카테고리의 다른 글

SharedPreferences  (0) 2022.01.31
ListView  (0) 2022.01.31
Intent  (0) 2022.01.29
EditText&Button  (0) 2022.01.29
TextView  (0) 2022.01.29

Java

Format : setOnClickListener(new View.OnClickListener() { });

new Intent(CurrentActivity.this, NextActivity.class) : Be careful of the type, Next Activity should be class

 

* We usually use dp for view size, sp for text size.

 

str = EditText.getText().toString() : get EditText's text and put it into str with string type

Intent.putExtra("key", value);

 

Toast : Pop-up screen from bottom

Toast.makeText(getApplicationContext(), "String", Toast.LENGTH).show();

 

출처 : https://www.youtube.com/playlist?list=PLC51MBz7PMyyyR2l4gGBMFMMUfYmBkZxm

'Android' 카테고리의 다른 글

SharedPreferences  (0) 2022.01.31
ListView  (0) 2022.01.31
Package  (0) 2022.01.30
EditText&Button  (0) 2022.01.29
TextView  (0) 2022.01.29

android:hint

hint for input view

 

android:orientation

vertical / horizontal, how to arrange

 

.java

findViewById : mapping variables to object

setOnClickListener : Work to do when user clicked button

'Android' 카테고리의 다른 글

SharedPreferences  (0) 2022.01.31
ListView  (0) 2022.01.31
Package  (0) 2022.01.30
Intent  (0) 2022.01.29
TextView  (0) 2022.01.29

+ Recent posts