Tutorial

Android simple splash screen

Hi, I have seen that many android starters have problems in implementing their own splash screen in Android (as I had once).UPDATE: As Rafael noticed me, there is also an improvement to be made on the splash screen and this is when the user presses the back button on the splash screen, we should avoid […]

,
Snippets, Tutorial

Android Vibrate on Click

If you want to make the phone to vibrate when you click on a button from your application: 1. You have to declare in your AndroidManifest.xml the permission: <uses-permission android:name=”android.permission.VIBRATE”/> 2. Now go to the class you want to put the vibration and in onCreate put this code: final Vibrator vibe = (Vibrator) yourActivity.this.getSystemService(Context.VIBRATOR_SERVICE); //replace

, ,
Snippets, Tutorial

Android EditText text changes Listener

If you want “listen” to the text changes from an EditText you have to use the TextWatcher. Bellow I will show you an example of TextWatcher: //first, we create an EditText EditText answer = new EditText(this); //second, we create the TextWatcher TextWatcher textWatcher = new TextWatcher() { @Override public void beforeTextChanged(CharSequence charSequence, int i, int

, ,
Tutorial

Detect when Done key is pressed

If you want to detect when a key from soft keyboard is pressed, like Done key, you can use the following code: mEditText = (EditText)findViewById(R.id.edit); mEditText.setOnEditorActionListener(new TextView.OnEditorActionListener() { @Override public boolean onEditorAction(TextView v, int actionId, KeyEvent event) { //verifies what key is pressed, in our case verifies if the DONE key is pressed if (actionId

, ,
Solutions, Tutorial

Android SSL self signed certificate pass by

This is not my work, I have just found the solution some time ago on the internetUsing the class below you can pass by the ssl certificate error that Android may throw when you are trying to connect to a self signed certified server:First the EasySSLSocketFactory class : import java.io.IOException; import java.net.Socket; import java.net.UnknownHostException; import java.security.KeyManagementException; import

, ,
sponsored
Exit mobile version