Posts

Android Coundown seek bar android studio.

Image
public class MainActivity extends AppCompatActivity { TextView timeShow; SeekBar seekBar; Button startButton; CountDownTimer countDownTimer; boolean countdownActive = false; public void pressToStart(View view){ if (countdownActive){ checkActive(); }else { countdownActive = true; seekBar.setEnabled(false); startButton.setText("Stop!"); countDownTimer = new CountDownTimer(seekBar.getProgress() * 1000 + 200, 1000) { @Override public void onTick(long millisUntilFinished) { countDownSetter((int) millisUntilFinished / 1000); } @Override public void onFinish() { MediaPlayer mediaPlayer = MediaPlayer.create(getApplicationContext(), R.raw.goodmorning); mediaPlayer.start(); checkActive(); } }.start(); } } private void checkActive() { countdownActive = false; seekBar.setEnabled(true); startButton.setText("Start"); countDownTimer.cancel(); timeShow.setText("0:30"); seekBar.setProgress(30); seekBar.setMax(600); } public void countDownSetter(int progress){ int m...

Add an Action to the Toolbar part 5

Image

Tablayotu part 1

Image

Nested Linear layout part 3

Image

linear layout(horizontal ) part 2

Image

linear layout in android . working with linear layout in android studio

Image

Bottom Navigation Bar for Android

Image

incompatible hax module version 3 requires minimum version 4 no accelerator found

The SDK Manager will download the installer to the "extras" directory, under the main SDK directory. Even though the SDK manager says "Installed" it actually means that the Intel HAXM executable was downloaded. You will still need to run the installer from the "extras" directory to finish installation. So here is what you need to do: Download HAXM installer from  SDK Manager->Android SDK->SDK Tools->HAXM installer Open  <SDK_SRC>/extras/intel/Hardware_Accelerated_Execution_Manager/  and click the .dmg file to start install. After installed manually, it's better to restart your PC. Try to uninstall "Intel x86 Emulator Accelerator (HAXM installer)" from Android SDK manager, than install it again. That helped for me. Source

How do you change text to bold in Android?

Programmatically: You can do programmatically using setTypeface() : textView . setTypeface ( null , Typeface . NORMAL ); // for Normal Text textView . setTypeface ( null , Typeface . BOLD ); // for Bold only textView . setTypeface ( null , Typeface . ITALIC ); // for Italic textView . setTypeface ( null , Typeface . BOLD_ITALIC ); // for Bold and Italic XML: You can set Directly in XML file in <TextView /> like: android : textStyle = "normal" android : textStyle = "normal|bold" android : textStyle = "normal|italic" android : textStyle = "bold" android : textStyle = "bold|italic" Source: here Programmatically: You can do programmatically using setTypeface() method: Below is the code for default Typeface textView . setTypeface ( null , Typeface . NORMAL ); // for Normal Text textView . setTypeface ( null , Typeface . BOLD ); // for Bold only textVie...

Can't import database through phpmyadmin file size too large xampp

 Here is what I've done: Gone to my XAMPP installed directoy C:\xampp\php Open the "Configuration Settings" file named php.ini using your text editor, preferably you can also you Notepad for Windows machine. Somewhere nearby on line no 886, please update it to upload_max_filesize = 128M Similarly on line no 735 post_max_size = 128M On line no 442 max_execution_time = 300 On line no 452 max_input_time = 60 Restart your Apache from either XAMPP Control Panel or using CMD in Windows https://stackoverflow.com/a/6723485/969092 Done! Source: here

Gradle project refresh failed android studio

These steps work for me : Close android studio first Go to folder C:\Users\.gradle and delete that folder. Then in gradle folder create gradle.properties file and add following lines. org . gradle . daemon = true org . gradle . parallel = true Open android studio source: here

how to create SplashScreen android studeio

splash Screen Android Studio

How to indent android studio xml and java code

Indent code in  Android Studio : Windows Ctrl + Alt + L Mac: Option  +  Command  +  L  Stack Overflow

how to use text box in android studio

Image
-------------------------------buttonbox--------------------- <? xml version= "1.0" encoding= "utf-8" ?> < shape xmlns: android = "http://schemas.android.com/apk/res/android" android :shape= "rectangle" > < gradient android :startColor= "@android:color/transparent" android :endColor= "@android:color/transparent" android :angle= "270" /> < corners android :radius= "30dp" /> < stroke android :width= "5px" android :color= "@android:color/white" /> </ shape > ===========================end button box===================== -----------------------------textboxes.xml-------------------- <? xml version= "1.0" encoding= "utf-8" ?> < shape xmlns: android = "http://schemas.android.com/apk/res/android" android :shape= "rectangle" android :padding= "10dp...

laravel update and delete function using Resource controller

We can update and delete from database using  laravel 5.5 .  public function update(Request $request, $id)     {          $this->validate($request,[             'title' => 'required',             'sub_title' => 'required',             'image' => 'mimes:jpeg,jpg,bmp,png',         ]);         $image = $request->file('image');         $slug = str_slug($request->title);         $slider = Slider::find($id);         if (isset($image))         {             $currentDate = Carbon::now()->toDateString();             $imagename = $slug .'-'. $currentDate .'-'. uniqid() .'.'. $image->getClientOriginalExtension();       ...

Laravel: how i can use store function in laravel 5.5

we have 3 fields like title, subtitle, image we can save data to public directory Upload/slider folder a logic implementation like this public function store(Request $request)     {          $this->validate($request,[             'title' => 'required',             'subtitle' => 'required',             'image' => 'mimes:jpeg,jpg,bmp,png',         ]);         $image = $request->file('image');         $slug = str_slug($request->title);         if (isset($image))         {             $currentDate = Carbon::now()->toDateString();             $imagename = $slug .'-'. $currentDate .'-'. uniqid() .'.'. $image->getClientOriginalExtension();         ...

Detect and extract url from a string?

We can get URL from the text or String. /** * Returns a list with all links contained in the input */ public static List < String > extractUrls ( String text ) { List < String > containedUrls = new ArrayList < String >(); String urlRegex = "((https?|ftp|gopher|telnet|file):((//)|(\\\\))+[\\w\\d:#@%/;$()~_?\\+-=\\\\\\.&]*)" ; Pattern pattern = Pattern . compile ( urlRegex , Pattern . CASE_INSENSITIVE ); Matcher urlMatcher = pattern . matcher ( text ); while ( urlMatcher . find ()) { containedUrls . add ( text . substring ( urlMatcher . start ( 0 ), urlMatcher . end ( 0 ))); } return containedUrls ; } Example: List < String > extractedUrls = extractUrls ( "Welcome to https://stackoverflow.com/ and here is another link http://www.google.com/ \n which is a great search engine" ); for ( String url : extractedUrls ) { System . out . ...