Quantcast
Channel: EmotiCODE - Snippets and Source Code Search Engine
Browsing all 110 articles
Browse latest View live

Android SDK - Android pull to refresh ListView ( PullDownListView custom view )

import android.content.Context; import android.util.AttributeSet; import android.view.MotionEvent; import android.widget.AbsListView; import android.widget.AbsListView.OnScrollListener; import ...

View Article



Android SDK - Android SDK Notification.Builder example

Intent notificationIntent = new Intent(ctx, YourClass.class); PendingIntent contentIntent = PendingIntent.getActivity(ctx, YOUR_PI_REQ_CODE, notificationIntent, PendingIntent. ...

View Article

Android SDK - Send data from a Notification to its intent Activity

/* * Send the notification. */ Intent notificationIntent = new Intent(getApplicationContext(), viewmessage.class); notificationIntent.putExtra("NotificationMessage", notificationMessage); ...

View Article

Android SDK - AlertDialog with AlertDialog.Builder example

public void showAlert( String title, String message, int Icon ) { AlertDialog alertDialog = new AlertDialog.Builder(this).create(); alertDialog.setTitle( title ); alertDialog.setMessage( ...

View Article

Android SDK - Setup ActionBar title and subtitle for newer Android versions

/** * Sets the Action Bar for new Android versions. */ @TargetApi(Build.VERSION_CODES.HONEYCOMB) private void actionBarSetup() { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB ...

View Article


Android SDK - Use standard Apache common FTP library to store a file.

ftpClient.connect(InetAddress.getByName(server)); ftpClient.login(user, password); ftpClient.changeWorkingDirectory(serverRoad); ftpClient.setFileType(FTP.BINARY_FILE_TYPE); BufferedInputStream ...

View Article

Android SDK - Get phone ringer status ( muted or normal )

final AudioManager audioManager = (AudioManager) getSystemService(Context.AUDIO_SERVICE); // Play sound only if not muted if( audioManager.getRingerMode() == AudioManager.RINGER_MODE_NORMAL ) { ...

View Article

Android SDK - "Rate My App" user remainder.

public class AppRater { private final static String APP_TITLE = "YOUR-APP-NAME"; private final static String APP_PNAME = "YOUR-PACKAGE-NAME"; private final static int ...

View Article


Android SDK - Android - Add custom Y labels with AChartEngine

// disable the default Y labels first renderer.setYLabels(0); // add several custom labels renderer.addYTextLabel(y, "label ...

View Article


Android SDK - Using NetBIOS packets to discover network computers

public class NetworkDiscovery extends Thread { public static final String TAG = "NetworkDiscovery"; public static final String NEW_ENDPOINT = "NetworkDiscovery.action.NEW_ENDPOINT"; ...

View Article

Android SDK - Get the application version programmatically

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

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 - 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 - Check if a service is already running.

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

View Article

Android SDK - Send a SMS message with Android.

A snippet to send SMS text messages with Android SDK.

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 - See if Google Services apk is installed

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

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

Interaction between Activity and Service example.

An example interaction between an Activity and a Service 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
Browsing all 110 articles
Browse latest View live




Latest Images