Monday, February 1, 2016

info Android Material

Good read about Material Design

Components:
snackbar

Drawables tutorial

info Android Testing (and iOS)

Mobile Testing background

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


Android
Robolectric for unit testing,
Espresso for UI testing,



iOS
Xcode XCTest

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

Robolectric:
Very Good Tutorial
http://robolectric.blogspot.com/2010/12/testing-startactivityforresult-and.html
http://turhanoz.com/unit-test-android-starting-an-activity/
https://github.com/codepath/android_guides/wiki/Unit-Testing-with-Robolectric

-----------------
Appium:
Appium(python) and AWS Device Farm - Cloud testing
http://docs.aws.amazon.com/devicefarm/latest/developerguide/getting-started.html
iOS Video Example (*very good tutorial*)
 https://www.youtube.com/watch?v=CLeb1wjctuU
Getting started: http://docs.aws.amazon.com/devicefarm/latest/developerguide/getting-started.html 

----------------------
XCTest

 ----------------------
Espresso

Espresso vs Robotium



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


Follow this tutorial: https://codelabs.developers.google.com/codelabs/android-testing/index.html?index=..%2F..%2Fandroid-dev-summit&viewga=UA-69243313-1#5

Testing Fundamentals:
http://developer.android.com/tools/testing/testing_android.html

Slides:
http://www.slideshare.net/dtmilano/introduction-to-android-testing?related=1

CodePath testing guide 


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




------------------------------------------------------------------------------------------------------------
Resources:
 https://developer.android.com/tools/testing-support-library/index.html#AndroidJUnitRunner
https://google.github.io/android-testing-support-library/
https://codelabs.developers.google.com/codelabs/android-testing/#0


Thursday, January 7, 2016

SharedPreferences in Android [ put string and get string ]

PUT
private SharedPreferences sharedPreferences;
sharedPreferences.edit()
        .putString("KEY_NAME", name)
        .apply();


GET
String NameURL= getPref("KEY_NAME", getContext());

public static String getPref(String key, Context context) {
    SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(context); 
  return preferences.getString(key, null);
 
 
 
Resources: 
https://medium.com/google-developers/sharedpreferences-is-your-answer-to-simple-storage-a7c8499ea8ff#.7eoyjrjgi

Thursday, December 17, 2015

How to run Android App with latest Android tools


Google Android info

Android Styling:
 https://blog.stylingandroid.com/percent-part-1/

Install latest Android Studio:

Install latest Android emulator:

Enable Instant run:

Google Android tech docs:


Android developers blog
http://android-developers.blogspot.com/

Android best practices:
https://github.com/futurice/android-best-practices
 http://guides.codepath.com/android

Android devices Dashboard(google)
https://developer.android.com/about/dashboards/index.html


SourceTree uncommit
http://flummox-engineering.blogspot.com/2014/10/how-to-undo-git-commit-in-sourcetree.html

Wednesday, December 16, 2015

Butterknife Library for Android

Butterknife 

Is a view "injection" library for Android. It will reduces boilerplate code.

Example:
  1. Add dependency to app/build.gradle
dependencies {
  compile 'com.jakewharton:butterknife:7.0.1'
}
  1. In main.xml declare an image widget id name "image"
  2. In main.java start using @Bind to declare each variable 

public class Main extends AppCompatActivity {
private static final String ITENT_TAG= "chapter"; 

private Chapter chapter;

@Bind(R.id.button) Button myButton; 

@Bind(R.id.text) TextView myText;

@Bind(R.id.image) 

ImageView myImage;  

@Override public void onCreate(Bundle savedInstanceState) 

{
super.onCreate(savedInstanceState);   setContentView(R.layout.activity_detail);   ButterKnife.bind(this); 

@OnClick(R.id.button) protected void Toast(){

Toast.makeText(getApplicationContext(),"Hello Android Butter Knife",Toast.LENGTH_LONG).show();}

}

myText.setText("Hello!");

res = getResources();
myImage.setImageDrawable(res.getDrawable(R.drawable.myimage));



  • Also initialize ButterKnife in OnCreate:
 ButterKnife.bind(this);


Resources:
http://www.sitepoint.com/tidying-code-with-android-butterknife/
https://guides.codepath.com/android/Reducing-View-Boilerplate-with-Butterknife

Sunday, December 13, 2015

Crashlytics for Android app

What is Crashlytics?

  • It's a great tool for developers; developer can get a lot of statics from the app... it's free.
  • Delivers crash reporting across devices in real-­time. 
  • Performs analysis of every thread on every Android device to identify the most important issues.
**Usage is super easy**

How to Setup:

  1. Register here https://get.fabric.io/
  2. In Android Studio install the Crashlytics plugin -Android Studio -> Preferences -> Plugins -> "Fabric plugin" Install 
  3. Now you will have the Fabric icon in Android Studio (image one below).
  4. Now select your app and enable Crashlytics, everything will be setup automatically just follow the instructions provided.
  5. Done. Build and install your App.
  6. Go to https://fabric.io/ to see the statistics of your app(image two below).
(image one)















(image two)





References:
http://www.crashlytics.com/blog/its-finally-here-announcing-crashlytics-for-android/
https://fabric.io/kits/android/crashlytics/summary

Great tutorial:
http://www.codedevplus.com/integrating-crashlytics-from-fabric-in-android/
https://fabric.io/kits/android/crashlytics/install