Monday, August 12, 2013

Knowing the Command you used in eclipse to run a program

I was working on a combination of scala with hadoop. After getting addicted to usage of eclipse IDE, It became too difficult to run the same job on command line. You can get the command you used in eclipse by following below simple steps.


  • Run a Program
  • open debug perspective mode.
  • wait till the job complete or terminate it
  • In debug right click on <terminated : exit value 1> and select properties.



Saturday, July 27, 2013

Scala Regex

Match Groups

val imageurlpattern = """data-context-item-id="([^"]*)""".r
println((imageurlpattern findFirstMatchIn singleMovieDetail).get.group(1))

Tuesday, June 18, 2013

google maps v2 illegalStateException

java.lang.IllegalStateException: Not connected. Call connect() and wait for onConnected() to be called.

This happens when you request for locationupdates before the actual location connection is established. Instead use a boolean variable to check if connection is established or call for locationupdates as below in onConnected.

@Override
        public void onConnected(Bundle connectionHint) {
                Toast.makeText(this, "Connected", Toast.LENGTH_SHORT).show();
                mLocationClient.requestLocationUpdates(mLocationRequest, this);
         
        }

Wednesday, March 20, 2013

Creating HyperLinks in Large Text (TextView) - Android

String.xml

------------

<string name="totalText">Hello <u>World</u></string>



public void hyperlinkWordsInText()
{
 Spanned sequence = html.fromhtml (context.getstring (r.string.totalText));
 Spanablestringbuilder strbuilder = new Spanablestringbuilder(sequence);

 Underlinespan [] underlines = strbuilder.getspans (0, sequence.length (), Underlinespan.class);
  For (Underlinespan span : underlines)
  {
  int start = strBuilder.getSpanStart(span);
  int end = strBuilder.getSpanEnd(span);
  int flags = strBuilder.getSpanFlags(span);
  ClickableSpan myActivityLauncher = new ClickableSpan()
  {
   public void onClick(View view)
   {
    // do wat ever u want on click
   }
  
  };
  strBuilder.setSpan(myActivityLauncher,start,end,flags);
   
   
  }
txt.setText(strBuilder);
txt.setMovementMethod(LinkMovementMethod.getInstance());
}

Tuesday, March 5, 2013

Learning jquey (Tutorials)

Reading styled data from String.xml - Android


<string name="my_text">
  <![CDATA[
    <b>Autor:</b>Prashanth Madi<br/>
    <b>Contact:</b>prm0080@gmail.com<br/>
    <i>Copyright © 2012-2013  </i>
  ]]>
</string> 
From our Java code we could now utilize it like this:
TextView tv = (TextView) findViewById(R.id.myTextView);
tv.setText(Html.fromHtml(getString(R.string.my_text))); 

Sunday, November 25, 2012

List of Good Android Stuff (Tutorials)




http://www.vogella.de/android.html

http://www.droidnova.com/first-list-application,37.html

http://www.youtube.com/watch?v=QL5uaaOJQiE&feature=mfu_in_order&list=UL

^ really good tutorial

http://www.learn-android.com/2010/01/05/android-layout-tutorial/2/

free icon : http://www.softicons.com/free-icons/computer-icons/iphone-4g-icons-by-mike-demetriou/
iphone-4g-headphones-icon

Different layouts: http://www.learn-android.com/2010/01/05/android-layout-tutorial/4/

calling GPS : http://www.helloandroid.com/tutorials/calling-system-settings-android-app-gps-example

fancy Menu : http://stackoverflow.com/questions/4997166/how-to-make-a-fancy-transparent-menu-
like-the-share-menu-in-android-gallery

Gallery Example: http://saigeethamn.blogspot.com/2010/05/gallery-view-android-developer-
tutorial.html

http://www.cs.umd.edu/class/fall2011/cmsc436/CMSC436/Source_Code_Examples.html

Android Icons: http://androiddrawableexplorer.appspot.com/

Android Simple web service example:

http://sarangasl.blogspot.com/2011/10/android-web-service-access-tutorial.html

Multithreading http://www.youtube.com/watch?v=i4EzFb7m_cQ&feature=relatedal

Tutorial Series for Music Player with Service Tutorial:

http://www.youtube.com/watch?v=J3kwFMkAsJ0&feature=relmfu

Login screen with Database:

http://www.androidhive.info/2012/01/android-login-and-registration-with-php-mysql-and-sqlite/

Custom layout:

http://www.xoriant.com/blog/mobile-application-development/android-ui-design-
pattern-%E2%80%93-quick-action-bar.html

Android Dashboard Design Tutorial:

http://www.androidhive.info/2011/12/android-dashboard-design-tutorial/

Android Gallery tutorial:

http://vikaskanani.wordpress.com/2011/07/20/android-custom-image-gallery-with-checkbox-in-grid-to-
select-multiple/

Android Color code:

http://www.ceveni.com/2009/08/set-rgb-color-codes-for-android-and-rgb.html

Android All widget example

http://www.droiddraw.org/widgetguide.html

interview question:

http://www.javacodegeeks.com/2011/08/android-interview-questions-answers.html

Android Custom object list tutorial (VVImportant)

http://www.learn-android.com/2011/11/22/lots-of-lists-custom-adapter/2/

Android Slider:

http://blog.codeus.net/dateslider-1-0-an-alternative-datepicker-for-android/rial

Spinner Tutorial

http://www.dcpagesapps.com/developer-resources/android/23-android-spinner-tips

upload Image on server

http://vikaskanani.wordpress.com/2011/01/11/android-upload-image-or-file-using-http-post-multi-
part/

Good Android Tutorial:

http://p-xr.com/

Custom Array Adaptor:

http://www.ezzylearning.com/tutorial.aspx?tid=1763429&q=customizing-android-listview-items-with-
custom-arrayadapter

http://www.softwarepassion.com/android-series-custom-listview-items-and-adapters/

http://coenraets.org/blog/android-samples/androidtutorial/

android Image Gallery:

http://dev.tscolari.me/2011/10/10/android-camera-and-image-gallery/

Android Sample tutorial list :

http://portiaplante.com/android/

Android Tutorial for Radio Group and shared preferances:

http://www.kaloer.com/android-preferences