Posts

Showing posts from January, 2017

how to create image scaling animation in android apps

Image
Learn how to create image scaling animation in android studio.It uses Animation class. You can use this in any app to make your app attractive and beautiful. MainActivity.java package com.singh.jassi.myanimation; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.view.View; import android.view.animation.Animation; import android.view.animation.AnimationUtils; import android.widget.Button; import android.widget.ImageView; public class MainActivity extends AppCompatActivity { ImageView imageView; Button b1; Animation animation; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); imageView=(ImageView)findViewById(R.id.imageView); b1=(Button)findViewById(R.id.button); imageView.setImageResource(R.drawable.myimage); animation= AnimationUtils.loadAnimation(getAppl

How to create android Text To Speech app

Image
Learn to create android text to speech app in android studio.It uses TextToSpeech class. You can use this in any app to speak your written text, reminder, notes and to create talkitive app. MainActivity.java package com.singh.jassi.texttospeech; import android.speech.tts.TextToSpeech; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.view.View; import android.widget.Button; import android.widget.EditText; import java.util.Locale; public class MainActivity extends AppCompatActivity { TextToSpeech tt; Button b1; EditText ed; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); tt=new TextToSpeech(getApplicationContext(),new TextToSpeech.OnInitListener() { public void onInit(int status) { if(status!=TextToSpeech.ERROR) tt.se

Alert Dialogs in android apps

Image
Learn how to create alert dialogs in android apps. We can get decisions and information from user through these alert dialogs. MainActivity.java package com.singh.jassi.alertdialog; import android.content.DialogInterface; import android.support.v7.app.AlertDialog; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.view.View; import android.widget.Button; import android.widget.Toast; public class MainActivity extends AppCompatActivity { public Button button; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); button=(Button)findViewById(R.id.button); } public void my_dialog(View view) { AlertDialog.Builder builder =new AlertDialog.Builder(MainActivity.this); builder.setIcon(R.mipmap.ic_launcher); builder.setTitle("Alert Dialog"); builder.setMess

C++

Image
Q.1 How we can get string as an input in C++ A. cin B. cout C. getline() D. scanf() View Answer  Q.2 How we can assign null value to string in c++ A. NULL B. null C. '' D. "" View Answer