Posts

how to set WebView in android studio

 Set your application on latest gradle version and now is running mostly androidx. you should carry it with android x. you have to set this code in your application and  XML Code <WebView android :id ="@+id/webv" android :layout_width ="match_parent" android :layout_height ="wrap_content" /> java code is WebView webView = findViewById(R.id. webv ) ; webView.loadUrl( "set your web address" ) ; WebSettings webSettings = webView.getSettings() ; webSettings.setJavaScriptEnabled( true ) ;

How to set Backpressed botton in android studio

Image
 let us know how to set backpressed in android application you can set in WebView and other online application. code is here. @Override     public void onBackPressed() {         WebView webView = findViewById(R.id.webv);         if (webView.canGoBack()){             webView.goBack();         }         else {             super.onBackPressed();         }

Set AdMob in Android Studio

 Hi guys, now you can earn money using your android skill and grow up your experience. fist of all read this ad Carefully. and ad this dependencies in gradle app   dependency implementation 'com.google.android.gms:play-services-ads:19.5.0' implement xml file banner AdView < com . google . android . gms . ads . AdView       xmlns : ads = "http://schemas.android.com/apk/res-auto"       android : id = "@+id/adView"       android : layout_width = "wrap_content"       android : layout_height = "wrap_content"       android : layout_centerHorizontal = "true"       android : layout_alignParentBottom = "true"       ads : adSize = "BANNER"       ads : adUnitId = "ca-app-pub-3940256099942544/6300978111" >   </ com . google . android . gms . ads . AdView > and now set java file MobileAds . initialize ( this , new OnInitializationCompleteListener () { ...

How to add clear button in android Studio.

 Hi guys we here providing our services to develop application. the first of  - you have to set your xml file and set i'd in button. - And go to java file. Code clear.setOnClickListener( new Button.OnClickListener() { public void onClick (View v) { textview.setText(""); } }); XML Code < Button android:id = "@+id/button1" android:layout_width = "wrap_content" android:layout_height = "34dp" android:layout_gravity = "center" android:text = "Clear" android:textSize = "15sp" android:textStyle = "italic" android:typeface = "normal" />