Quantcast
Channel: EmotiCODE - Snippets and Source Code Search Engine
Browsing index pages (110 articles)
↧

Block incoming and outgoing phone calls programmatically

Block incoming and outgoing phone calls programmatically

View Article


Turn off screen orientation sensor

A simple trick to avoid user change screen orientation in certain activities.

View Article


How to record a phone call on Android

This is how to use the MediaRecorder SDK class to record phone calls happening on the device, be aware that MediaRecorder.AudioSource.VOICE_CALL is not always supported by vendor since recording phone...

View Article

How to use Animations to animate a custom View

This is how to use Animations to animate a custom View. The following example uses the class TranslateAnimation which is the most basic one.

View Article

How to prevent finishing the Activity from Back button

Understand how to avoid the end of the activity through the back button using a alert dialog.

View Article


How create a Splash Screen

Wait 3 seconds before it goes to next activity. You can insert other programming features in run() (onCreate) and then removing the time in "nextScreen()", so the time of Splash Screen is determined by...

View Article

Programmatically install an APK to the user device

Programmatically installing an Android APK to the user device could be a useful trick to auto update your application, or installing dependencies to make it correctly work. The following snippet will...

View Article

Block incoming and outgoing phone calls programmatically.

This is how to programmatically block incoming and outgoing phone calls registering a broadcast receiver and a phone state listener.

View Article


How to start a phone call with the Android SDK

How to start a phone call with the Android SDK using the ACTION_CALL intent and a "tel:" parsable uri.

View Article


Parse json to JSONObject example

How to parse a json string to a JSONObject with the Android SDK.

View Article

Reflect device movements using SensorManager.

Registering as a SensorEventListener your Activity will receive in the onSensorChanged method on every event one of the device sensors trigger. This way you could remap the coordinate system of your...

View Article

Interaction between Activity and Service example.

An example interaction between an Activity and a Service with the Android SDK.

View Article

Handle screen orientation change with state persistance example.

An example of screen orientation change handling with some state persistance using the Bundle class.

View Article


Android SDK - See if Google Services apk is installed

Check if the client's device has the Google Services apk installed

View Article

Android SDK - List folder content with Dropbox API

The following snippet will log the content of a Dropbox folder using its API package.

View Article


Android SDK - Send a SMS message with Android.

A snippet to send SMS text messages with Android SDK.

View Article

Android SDK - Check if a service is already running.

Check if an Android service is already running given its name.

View Article


Android SDK - Check device CPU architecture.

Detect the CPU architecture of the device the application is running on, this method could be useful if your application depends on native code such as elf executables or JNI libraries with different...

View Article

Android SDK - Utility implementation for loading data which is pre-packages...

If you have raw data packaged with your application apk, this class could help you to access to those resources programmatically.

View Article

Android SDK - Get the application version programmatically

PackageInfo pInfo = getPackageManager().getPackageInfo(getPackageName(), 0); version = pInfo.versionName ...

View Article
Browsing index pages (110 articles)


Latest Images