Skip to main content

Posts

Add Auto Complete Textview To Your App

Add AutoCompleteTextview To Your App

1)Navigate to activity_main.xml .You have to add some code here. Watch the above  video for reference . After adding the code, your activity_main.xml will look like this:
<?xml version="1.0" encoding="utf-8"?> <RelativeLayout     xmlns:android="http://schemas.android.com/apk/res/android"     xmlns:app="http://schemas.android.com/apk/res-auto"     xmlns:tools="http://schemas.android.com/tools"     android:layout_width="match_parent"     android:layout_height="match_parent"     android:orientation="vertical"     tools:context=".MainActivity">

    <AutoCompleteTextView         android:id="@+id/autocompleteView"         android:layout_width="match_parent"         android:layout_height="wrap_content"         android:layout_alignParentStart="true"         android:layout_alignParentTop="true"         android:hint=&quo…
Recent posts

Working With Android Studio

Working With Android Studio   [# 1]


Video Link:       https://youtu.be/9zcki3STZ00


Please Watch The Above Video If You haven't Watched It Already


1)  Open Android Studioand create a new project .
2) Give a name for your application and also set the package name.


3) Set The API level




4) Choose an Activity



5) Set the Activity Name and Layout Name




6) Click On Finish. Your project will be ready in few minutes.

7) Navigate to the layout directory and open activity_main.xml file

8)The code used in the video is given here
<?xml version="1.0" encoding="utf-8"?><LinearLayout     xmlns:android="http://schemas.android.com/apk/res/android"     xmlns:app="http://schemas.android.com/apk/res-auto"     xmlns:tools="http://schemas.android.com/tools"     android:layout_width="match_parent"     android:layout_height="match_parent"     android:orientation="vertical"     tools:context=".MainActivity">

Create Custom Popup Window using Sketchware

Create Custom Popup Window using Sketchware


Refer the video below if  you get stuck. 

1) Add a custom view named window.You can name it according to your wish. 
2)Design your popup window. 
2) Now, In the logic section,In OnCLick event of button.Add the following  code
Create a view
View popupView = getLayoutInflater().inflate(R.layout.window, null);
Popup window 

final PopupWindow popup = new PopupWindow(popupView, ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT, true);
Initialize 
Button b1 = popupView.findViewById(R.id.button1); Button b2 = popupView.findViewById(R.id.button2);
OnClickListeners
b1.setOnClickListener(new OnClickListener() { public void onClick(View view) { //below code will dismiss the popup window popup.dismiss(); } });
b2.setOnClickListener(new OnClickListener() { public void onClick(View view) {
popup.dismiss(); } });
Show the popup window 
popup.showAtLocation(popupView, Gravity.CENTER, 0, 0);




Add Swipe To Refresh Feature To Your App using Android Studio

Add Swipe To Refresh Feature To Your App Using Android Studio


If you haven't watched the video watch it now!


Source Code
Android Manifest.xml



<manifest xmlns:android="http://schemas.android.com/apk/res/android"package="swiperefresh.com.swipetorefresh"> <uses-permission android:name="android.permission.INTERNET" /> <applicationandroid:allowBackup="true"android:icon="@mipmap/ic_launcher"android:label="@string/app_name"android:roundIcon="@mipmap/ic_launcher_round"android:supportsRtl="true"android:theme="@style/AppTheme"> <activity android:name=".MainActivity"> <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> </activity> </application> </manifest>…

Add SeekBar Inside Dialog Box

Add SeekBar Inside Dialog Box 



If you haven`t yet watched the video,Watch it Now...!




Open yourSketchware project.Add Dialog Box component. Go to the logic section & add the blocks which are necessary to create a dialog box.






Now you have to make some modifications.In order to add SeekBar you have to use add source directly block.Add the following code inside it.Please watch the above video for reference


final SeekBar cb1 = new SeekBar(MainActivity.this); LinearLayout.LayoutParams lpar = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.WRAP_CONTENT, LinearLayout.LayoutParams.WRAP_CONTENT); cb1.setLayoutParams(lpar); dialog.setView(cb1);
Inside the block "dialog OK Button Clicked", add the following code using add source directly block

textview1.setText(String.valueOf(cb1.getProgress()));





Thats It :)



Now Run your Application




If you have any doubtscomment below .

Create Text to speech converter app using Sketchware

Create Text to speech converter app using Sketchware








If you haven't yet watched the video , watch it right now !



Open Sketchware. Create new project .Go to the logic section  . In on Create event , add the following code


t1=new android.speech.tts.TextToSpeech(getApplicationContext(), new android.speech.tts.TextToSpeech.OnInitListener() {
@Override public void onInit(int status) {
if(status != android.speech.tts.TextToSpeech.ERROR) {
t1.setLanguage(Locale.UK); } } });
}android.speech.tts.TextToSpeech t1;
private void nothing(){




 Go to the logic section and tap on Button1 on Click event
Create a string variable named  "speak". Now set the value of that string variable using  blocks. Please watch the above video for Reference. Now use add source directly block and add the following code


t1.speak(speak, android.speech.tts.TextToSpeech.QUEUE_FLUSH, null);



Run the app.





If you have any doubts commentbelow




















Add Checkbox Inside Dialog Box | Sketchware tutorial

Add Checkbox Inside Dialog Box 




If you haven`t yet watched the video,Watch it Now...!

Open yourSketchware project.Add Dialog Box component. Go to the logic section & add the blocks which are necessary to create a dialog box. A screenshot is given below for your reference.



Now you have to make some modifications.In order to add checkbox you have to use add source directly block.Add the following code inside it.Screenshot is given below for your reference

final CheckBox cb1 = new CheckBox(MainActivity.this);
cb1.setText("CheckBox");
LinearLayout.LayoutParams lpar = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.WRAP_CONTENT, LinearLayout.LayoutParams.WRAP_CONTENT);
cb1.setLayoutParams(lpar);
dialog.setView(cb1);





Inside the block "dialog OK Button Clicked", add the following code using add source directly block


if(cb1.isChecked()){


After adding add source directly block,Use a toast block to toast "Checked..!"


Again Use add source directly block and ad…

Add Edittext Inside Dialog Box

Add Edittext Inside Dialog Box




If you haven`t yet watched the video...Watch it right now!!!


The code used in the above video is available here.
final EditText edittext1= new EditText(MainActivity.this); LinearLayout.LayoutParams lpar = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.WRAP_CONTENT, LinearLayout.LayoutParams.WRAP_CONTENT); edittext1.setLayoutParams(lpar); dialog.setView(edittext1);







textview1.setText(edittext1.getText());






Restrict the length of Edittext characters

Restrict the length of Edittext characters 


1) Open yoursketchware project.Add edittext. In the logic section, OnActivityCreate 


Add the following code

InputFilter[] editFilters = edittext1.getFilters();InputFilter[] newFilters =newInputFilter[editFilters.length +1];System.arraycopy(editFilters,0, newFilters,0

Add Admob Interstitial Ads To Your Sketchware Project Using AIDE

Add Admob Interstitial Ads To Your Sketchware Project Using AIDE







1) Export your Project from Sketchware. The project will be in the format of zip file.Extract it.Check whether any files are missing.In my case the build.gradle file was missing.So I copied the build.gradle file of my previous project and pasted it . Note : After pasting , change the application id in the build.gradle file to the package name of the project in which you want to add Ads














Skip the Above steps if your project file contains build.gradle


2) Open the project in AIDE . Navigate to build.gradle which is in the app directory
Add the following code 
compile 'com.google.android.gms:play-services-ads:+'




3)Navigate to AndroidManifest.xml and add the following Code


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




Also add the activity
<activity android:name="com.google.android.gms.ads.AdA…

Did you like this tutorial ?