Found 2041 Articles for Mobile Development

How to create Android Facebook Key Hash?

Azhar
Updated on 11-Sep-2019 11:45:46

946 Views

This example demonstrates about How to create Android Facebook Key HashGenerating a Development Key HashMac OS:- Execute below command in terminal keytool -exportcert -alias androiddebugkey -keystore ~/.android/debug.keystore | openssl sha1 -binary | openssl base64Windows:- Execute below command in command prompt keytool -exportcert -alias androiddebugkey -keystore "C:\Users\USERNAME\.android\debug.keystore" | "PATH_TO_OPENSSL_LIBRARY\bin\openssl" sha1 -binary | "PATH_TO_OPENSSL_LIBRARY\bin\openssl" base64Generating a Release Key Hashkeytool -exportcert -alias YOUR_RELEASE_KEY_ALIAS -keystore YOUR_RELEASE_KEY_PATH | openssl sha1 -binary | openssl base64Click here to download the project code.

How to integrate facebook in Android App?

Azhar
Updated on 03-Jul-2020 13:10:40

217 Views

This example demonstrates about How to integrate facebook in Android AppStep 1  − Create a new project in Android Studio, go to File ⇒ New Project and fill all required details to create a new project.Step 2  – Please follow Q21 to integrate Facebook.Step 3  − Add the following code to res/layout/activity_main.xml.     Step 4  − Add the following code to src/MainActivity.javapackage app.com.sample; import android.os.Bundle; import android.view.View; import android.widget.Toast; import androidx.appcompat.app.AppCompatActivity; import com.facebook.CallbackManager; import com.facebook.FacebookCallback; import com.facebook.FacebookException; import com.facebook.login.LoginManager; import com.facebook.login.LoginResult; public class MainActivity extends AppCompatActivity {    @Override    protected void onCreate(Bundle savedInstanceState) {       ... Read More

How to develop a soft keyboard for Android?

Azhar
Updated on 03-Jul-2020 13:18:14

749 Views

This example demonstrates how do I develop a soft keyboard for android.Step 1 − Create a new project in Android Studio, go to File ⇒ New Project and fill all required details to create a new project.Step 2 − Add the following code to res/layout/activity_main.xml.                 Step 3 − Add the following code to src/MainActivity.javaimport androidx.appcompat.app.AppCompatActivity; import android.os.Bundle; import android.view.View; import android.widget.EditText; import android.widget.TextView; public class MainActivity extends AppCompatActivity {    EditText editText;    TextView textView;    @Override    protected void onCreate(Bundle savedInstanceState) {       super.onCreate(savedInstanceState);       setContentView(R.layout.activity_main); ... Read More

How to create android app in facebook?

Azhar
Updated on 11-Sep-2019 11:40:22

168 Views

This example demonstrates about How to create android app in facebook We need to create Facebook App on Facebook developer site to get Facebook App ID. Please follow the following steps one by one. Go to https://developers.facebook.com/ and add new app.Step 1  - Enter you app name and email in given fieldsStep 2  – Add below line build.gradle/mavenDownload the SDK from the Maven Central Repository:buildscript { repositories { mavenCentral()}}Compile the latest version of the SDK:dependencies {    implementation 'com.facebook.android:facebook-android-sdk:[5, 6)' }Step 3  - Add Your Development and Release Key HashesGenerating a Development Key HashMac OS:- Execute below command in terminal ... Read More

How to create shadow in Android Buttons?

Azhar
Updated on 03-Jul-2020 13:12:56

8K+ Views

This example demonstrates how How to create shadow in Android Buttons.Step 1  − Create a new project in Android Studio, go to File ⇒ New Project and fill all required details to create a new project.Step 2  − Add the following code to res/layout/activity_main.xml.         Step 3  − Add the following code to src/MainActivity.javapackage com.medkart.sample; import androidx.appcompat.app.AppCompatActivity; import android.os.Bundle; public class MainActivity extends AppCompatActivity {    @Override    protected void onCreate(Bundle savedInstanceState) {       super.onCreate(savedInstanceState);       setContentView(R.layout.activity_main);    } }Step 4  − Add the following code to res/drawable/shadow_button_layer_list.xml       ... Read More

How to fix android.os.NetworkOnMainThreadException?

Azhar
Updated on 03-Jul-2020 13:11:21

2K+ Views

The exception that is thrown when an application attempts to perform a networking operation on its main thread.This is only thrown for applications targeting the Honeycomb SDK or higher. Applications targeting earlier SDK versions are allowed to do networking on their main event loop threads, but it's heavily discouraged.Kindly refer the below example program to fix this exception −This example demonstrates how do I fix the android.os.NetworkOnMainThreadException.Step 1 − Create a new project in Android Studio, go to File ⇒ New Project and fill all required details to create a new project. Step 2 −  Add the following code to res/layout/activity_main.xml.   ... Read More

Android, How to crop circular area from bitmap

Azhar
Updated on 03-Jul-2020 13:13:37

923 Views

This example demonstrates how to crop circular area from bitmap in Android .Step 1  − Create a new project in Android Studio, go to File ⇒ New Project and fill all required details to create a new project.Step 2  − Add the following code to res/layout/activity_main.xml.         Step 3  − Add the following code to src/MainActivity.javapackage com.medkart.sample; import androidx.appcompat.app.AppCompatActivity; import android.content.Context; import android.content.res.Resources; import android.graphics.Bitmap; import android.graphics.BitmapFactory; import android.graphics.Canvas; import android.graphics.Color; import android.graphics.Paint; import android.graphics.PorterDuff; import android.graphics.PorterDuffXfermode; import android.graphics.Rect; import android.graphics.RectF; import android.os.Bundle; import android.view.View; import android.widget.Button; import android.widget.ImageView; import android.widget.RelativeLayout; public class MainActivity extends AppCompatActivity ... Read More

How to crop circular area from bitmap in Android?

Azhar
Updated on 03-Jul-2020 12:53:52

135 Views

This example demonstrates how do I crop circular area from bitmap in android.Step 1 − Create a new project in Android Studio, go to File ⇒ New Project and fill all required details to create a new project.Step 2 − Add the following code to res/layout/activity_main.xml. Step 3 − Add the following code to src/MainActivity.javaimport androidx.appcompat.app.AppCompatActivity; import android.content.Context; import android.graphics.Bitmap; import android.graphics.BitmapFactory; import android.graphics.Canvas; import android.graphics.Color; import android.graphics.Paint; import android.graphics.Path; import android.graphics.PorterDuff; import android.graphics.PorterDuffXfermode; import android.os.Bundle; import android.view.MotionEvent; import android.view.View; public class MainActivity extends AppCompatActivity {    @Override    protected void onCreate(Bundle savedInstanceState) {       super.onCreate(savedInstanceState);   ... Read More

How to disable the click of home button of Android device?

Azhar
Updated on 03-Jul-2020 12:54:26

2K+ Views

This example demonstrates how to disable the click of home button of Android device .Step 1  − Create a new project in Android Studio, go to File ⇒ New Project and fill all required details to create a new project.Step 2  − Add the following code to res/layout/activity_main.xml.     Step 3  − Add the following code to src/MainActivity.javapackage com.medkart.sample; import androidx.appcompat.app.AppCompatActivity; import android.app.ActivityManager; import android.content.Context; import android.os.Bundle; public class MainActivity extends AppCompatActivity {    @Override    protected void onCreate(Bundle savedInstanceState) {       super.onCreate(savedInstanceState);       setContentView(R.layout.activity_main);    }    @Override    protected void onPause() { ... Read More

How to add a border to the top and bottom of an Android View?

Azhar
Updated on 03-Jul-2020 12:55:12

6K+ Views

This example demonstrates how to add a border to the top and bottom of an Android View .Step 1  − Create a new project in Android Studio, go to File ⇒ New Project and fill all required details to create a new project.Step 2  − Add the following code to res/drawable/border_top_bottom.xml                                                                       Step 3  − Add the following code to res/layout/top_bottom_border_in_android_view.xml ... Read More

Advertisements