Wednesday, December 17, 2014

Android controlling EditText input

Description: coming soon..

  • imeOptions flagNoFullscreen
  • imeOptions actionDone
  • inputType textUri

            android:contentDescription="Server IP"

Android: using AIDL


Let's say we want to define AIDL that we will use to communicate UI Fragment with AndroidService.

/** calls UI to Service **/

interface CommandServiceAIDL {
void setSomething(double value);

/** callbacks service to UI **/

interface MyListenerAIDL {
void onSomeEvent( boolean isOn);


Let's say we have a UI Fragment

import android.content.ServiceConnection;

public class MyFragment extends Fragment implements ServiceConnection {
// ...
   public void onCreate(Bundle savedInstanceState) {
    // we have to BIND this UI to AIDL service
      getActivity().getApplicationContext().bindService(new Intent(CommandConst.ACTION_BIND_SERVICE), this, Context.BIND_AUTO_CREATE);

// ...
   public void onDestroy() {
     // WE have to UNBIND this UI form AIDL service

// class that has all my AIDL methods
private MyServiceAIDL myServiceAIDL;

   public void onServiceConnected(ComponentName name, IBinder service) {
      myServiceAIDL = MyServiceAIDL.Stub.asInterface(service);
      try {
         // register this fragment as a client of the AIDL service
         myServiceAIDL.register(TAG, myServiceAIDL Callback);
      catch (RemoteException e) {
         Log.e(TAG, e.getMessage(), e);

private void doSomething(double value) {
         try {
         catch (RemoteException e) {


 private final MyListenerAIDL.Stub commandServiceCallback = new SimpleCommandServiceListener() {

      public void onSomeEvent(final boolean isOn) throws RemoteException { Runnable() {
            public void run() {
               if (someSwitch.isChecked() != isOn) {

Saturday, December 13, 2014

Android app deploying and monetizing

In this tutorial we will discuss what you need to do to deploy your app to the Google Play Market and how to make money $$$.

Monday, December 8, 2014

Android Studio: migrating to 1.0

Exciting moment -- Android Studio is not a baby anymore!
However, the rite of passage did not come without the growing pains.

Mac OS X: cpp tools

In this tutorial I will summarize how to install all tools needed to compile C++ code.

Install Apple's Command Line Tools:

$ xcode-select --install

xcode-select: error: command line tools are already installed, use "Software Update" to install updates

Saturday, December 6, 2014

SMS bid app


Use cases:
1) User creates offline list of items that will be used in an auction, example:
- sofa, pale blue, heavily used #sofa001
- mountain bike, barely used (I am developer not a sportsman) #bike002
- HTC ONE, Android phone, still working, AT&T #phone003
2) User distributes the list of bid items to FFF (family, friends and fools) by mailing, posting, etc.
3) User enters the bid items into the app
4) User enters the bid deadline per item into the app
6) User enters a minimum bid price per item into the app
7) FFF send SMS messages with bid in format:

bid #bike002 $30

8) The app tally up the highest bid and replies to FFF

- Minimum bid for item #bike002 is $30
- These is a higher bid for #bike002 in amount of $31

9) User can monitor the winning bids in the app

No bids

#bike002 minimum bid $30
- $31 from 6508151234
- $30 from 6508151432

10) there are many additional features you can add to this application

AndroidStudio: install *.md plugin

It is a common practice to provide a README text file in the root of the project.
The file usually specify:
- project overview
- project dependencies
- how to build the project
- copyrights

It is became the standard to write this file in a MarkDown format

Once you create a new *.md text file the AndroidStudio tells you that it does not recognize the format and to download the plugin.