Wednesday, 23 January 2013

Android Layout with Header Footer and scrollable Body content

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent" >

    <LinearLayout
        android:id="@+id/header"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:layout_alignParentTop="true"
        android:padding="10dp" >

        <TextView
            android:id="@+id/TextView01"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="header"
            android:textSize="40sp" >
        </TextView>
    </LinearLayout>

    <LinearLayout
        android:id="@+id/footer"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:layout_alignParentBottom="true"
        android:padding="10dp" >

        <TextView
            android:id="@+id/TextView02"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="footer"
            android:textSize="40sp" >
        </TextView>
    </LinearLayout>

    <ScrollView
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:layout_above="@id/footer"
        android:layout_below="@id/header" >

        <LinearLayout
            android:id="@+id/body"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:orientation="vertical" >

            <EditText
                android:id="@+id/edit1"
                android:layout_width="fill_parent"
                android:layout_height="wrap_content"
                android:padding="10dp" />

            <EditText
                android:id="@+id/edit2"
                android:layout_width="fill_parent"
                android:layout_height="wrap_content"
                android:padding="10dp" />

            <EditText
                android:id="@+id/edit3"
                android:layout_width="fill_parent"
                android:layout_height="wrap_content"
                android:padding="10dp" />

            <EditText
                android:id="@+id/edit4"
                android:layout_width="fill_parent"
                android:layout_height="wrap_content"
                android:padding="10dp" />

            <EditText
                android:id="@+id/edit5"
                android:layout_width="fill_parent"
                android:layout_height="wrap_content"
                android:padding="10dp" />

            <EditText
                android:id="@+id/edit6"
                android:layout_width="fill_parent"
                android:layout_height="wrap_content"
                android:padding="10dp" />

            <EditText
                android:id="@+id/edit7"
                android:layout_width="fill_parent"
                android:layout_height="wrap_content"
                android:padding="10dp" />

            <EditText
                android:id="@+id/edit8"
                android:layout_width="fill_parent"
                android:layout_height="wrap_content"
                android:padding="10dp" />

            <Button
                android:id="@+id/btn"
                android:layout_width="fill_parent"
                android:layout_height="wrap_content"
                android:text="Submit" />
        </LinearLayout>
    </ScrollView>

</RelativeLayout>
 

Note : Add android:windowSoftInputMode="adjustPan" to your activity in Android manifest.

If it does not work then add the following in the oncreate method of the activity

getWindow().setSoftInputMode(
                WindowManager.LayoutParams.SOFT_INPUT_ADJUST_PAN);

output:

 

 

 

Monday, 21 January 2013

Invalid Project Description Eclipse Error

This error is due to overlapping of workspaces
To fix this create seperate folder in workspace and import your project there it works well

Wednesday, 16 January 2013

Lock footer at bottom(Layout arrangement)

<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android" 
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:fillViewport="true">
<LinearLayout
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:orientation="vertical">

    <!-- HEADER -->
    <LinearLayout
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:orientation="vertical"
    />

    <!-- BODY -->
    <LinearLayout
        android:layout_width="fill_parent"
        android:layout_height="0dip"
        android:layout_weight="1"
        android:orientation="vertical"
    />

    <!-- FOOTER -->
    <LinearLayout
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:orientation="vertical"
    />
</LinearLayout>
</ScrollView> 
 
Note:Design the layout in the above manner and you 
will not get footer when user clicks edit textbox in UI 

Badge Effect in Android

package com.example.badge;

import android.os.Bundle;

import android.app.Activity;
import android.view.Menu;
import android.widget.TextView;

public class MainActivity extends Activity {

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        TextView tv1 = (TextView) findViewById(R.id.textView1);
       
       
               
       
    }

  
}


activity_main.xml

<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/frameLayout1"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content" >

    <ImageView
        android:id="@+id/imageView1"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:src="@drawable/ic_launcher" />

    <TextView
        android:id="@+id/textView1"
        android:layout_width="20dip"
        android:layout_height="20dip"
        android:layout_gravity="top|right"
        android:background="@drawable/circle"
        android:gravity="center"
        android:padding="2sp"
        android:text="5"
        android:textColor="@android:color/black"
        android:textStyle="bold" />

</FrameLayout>


Circle.xml

<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item>

    <shape android:shape="oval"  >
        <solid android:color="@android:color/black" />
    </shape>

</item><item
    android:bottom="1dp"
    android:left="1dp"
    android:right="1dp"
    android:top="1dp">

    <shape android:shape="oval" >
        <solid android:color="@android:color/darker_gray" />
    </shape>

</item>
</layer-list>


Output

 


Thursday, 20 December 2012

links

best link for android timers

http://www.fampennings.nl/maarten/android/04timers/index.htm
orientation best link

Orientation Change
http://blog.andresteingress.com/2011/09/27/fighting-orientation-changes-in-android/

canvas below link

http://courses.coreservlets.com/Course-Materials/pdf/android/Android-Drawing-1.pdf


Mecurial url

http://mercurialeclipse.eclipselabs.org.codespot.com/hg.wiki/update_site/stable


ListView
http://androidfreakers.blogspot.in/2011/10/custom-listview-with-checkbox.html

Layouts Android

http://wptrafficanalyzer.in/blog/different-layouts-for-different-screen-sizes-in-android/

Footer problem

http://blogactivity.wordpress.com/2012/02/22/smart-headers-and-footers-in-scrollviews/

Badge icon

http://vardhan-justlikethat.blogspot.in/search/label/Android?updated-max=2011-12-09T04:00:00-08:00&max-results=20&start=15&by-date=false

Layout_Weight Tutorial

http://www.chess-ix.com/2012/01/17/the-use-of-layout_weight-with-android-layouts/


Splash-Screen in two forms
http://www.sherif.mobi/2012/09/how-to-create-splash-activity-best.html
Above link will tell how to start method or activity after some time say 30 min or 5 seconds etc

 Find Device Height and width
http://android-er.blogspot.in/2009/08/exercise-get-screen-resolution-using.html

  Multiple Choice Listview is in google site check when needed

 Open S/W to draw UML diagrams
http://dia-installer.de/download/index.html.en

  Mercurial S/W download link
http://mercurial.selenic.com/wiki/Download


Json Parsing Tutorial
http://www.androidhive.info/2012/01/android-json-parsing-tutorial/

Customised  views Tutorial 
http://www.jayway.com/2012/07/03/creating-custom-android-views-part-2-how-padding-works-and-how-to-draw-your-own-content/

BarChart and PieChart 
http://typicaljava.blogspot.in/2013/03/draw-bar-chart-in-android.html 

Array List Compare in java


 http://sanjaal.com/java/686/java-utilities/java-tool-to-compare-two-lists-and-spit-out-the-differences-working-example/

 Scrollview to listview
http://www.androidhub4you.com/2012/12/listview-into-scrollview-in-android.html 

SourceTree 
http://www.sourcetreeapp.com/download/ 

Android CustomView links 
http://devmaze.wordpress.com/2011/05/22/236/
http://www.infidian.com/2008/05/02/android-tutorial-42-passing-custom-variables-via-xml-resource-files/ 

 Adding badge using aliasing feature of activity
http://derivedcode.wordpress.com/2013/10/09/showing-badge-or-count-in-android-app-icon/ 

HomeButton Press[when we have 4 activities and we click home button when we are in forth activity then again when we launch app should start from first activity]
  
http://stackoverflow.com/questions/5308088/kill-all-activities-when-home-key-is-pressed-android

 Java Tutorial
http://www.java2novice.com/java_exception_handling_examples/ 

 Singleton Java Interview Questions
 http://javarevisited.blogspot.sg/2011/03/10-interview-questions-on-singleton.html


convert list to CSV format
http://www.java2novice.com/java-collections-and-util/arraylist/list-to-csv/


Multi Threading
 http://javarevisited.blogspot.sg/2011/07/java-multi-threading-interview.html

Java Serialization
http://javarevisited.blogspot.sg/2011/04/top-10-java-serialization-interview.html




Android Battery
http://www.compiletimeerror.com/2013/05/android-battery-percentage-example.html#.Uu8qFRBqPIU
http://mihaifonoage.blogspot.sg/2010/02/getting-battery-level-in-android-using.html




JavaEnum Singleton
 http://javarevisited.blogspot.sg/2012/07/why-enum-singleton-are-better-in-java.html



Nice Tutorial on NDK
http://www.swig.org/Doc2.0/Android.html

Face Book Style slide menu android

http://www.oodlestechnologies.com/blogs/Facebook-Style-Slide-Menu-In-Android



Best link of how to Debug native code
http://visualgdb.com/tutorials/android/codebug/




Best link to start html5 apps using eclipse and phoneGap
http://cleancodedevelopment-qualityseal.blogspot.sg/2012/12/first-phonegap-app-with-android-using.html


Parsing of JSONData and Display in the listview
http://adblogcat.com/parse-json-data-from-a-web-server-and-display-on-listview/







Complete Java Course Tutorial best link  
https://www.udemy.com/java-tutorial/  



 

https://www.udemy.com/learn-android-programming-from-scratch-beta/


 Best link for GCM Client and Server
http://avilyne.com/?p=267 


How to use a ScheduledThreadPoolExecutor
http://codelatte.wordpress.com/2013/11/13/49/

Four ways of scheduling recurring task in android
http://stackoverflow.com/questions/14376470/scheduling-recurring-task-in-android 

Best link on Java Annotations
http://www.java2novice.com/java-annotations/custom/ 

Best link on how to implement Google Play Services

 http://www.androiddesignpatterns.com/2013/01/google-play-services-setup.html


Best link for android interview questions
http://blog.icorethink.com/interviewque/android-interview-questions-and-answers/
http://ramsandroid4all.blogspot.in/2014/05/customizing-edittext.html
 
 Badge ICON similar to IOS in Android
http://vardhan-justlikethat.blogspot.de/2014/07/android-ios-style-badge-app-icon-for.html
My google site contains this sample project

Dynamically inflating the layout
http://www.mysamplecode.com/2011/10/android-dynamic-layout-using-xml-add.html 

 how to browse sqlite data in emulator
http://www.techrepublic.com/blog/software-engineer/browse-sqlite-data-on-the-android-emulator/

 Best link for gallery with dots(page indicator)
http://www.myandroidsolutions.com/2012/04/21/android-gallery-with-dots-on-scroll/ 

 hashmap-single-key-multiple-values
http://www.skilledmonster.com/2013/10/21/hashmap-single-key-multiple-values-example/ 

Best link for custom Toggle Button

http://www.coderzheaven.com/2012/05/20/create-custom-toggle-button-android/ 
check google site too 

ANT Script Links

http://jeffreysambells.com/2013/02/14/build-your-android-apk-with-the-manifest-version-number
http://www.irasenthil.com/2013/01/android-how-to-version-command-line.html
http://www.programmingodyssey.com/2013/01/create-signed-build-of-android.html  

VS Communication with hardware
http://english.cxem.net/arduino/arduino5.php
http://digitalhacksblog.blogspot.de/2012/05/arduino-to-android-basic-bluetooth.html
http://digitalhacksblog.blogspot.de/2012/05/arduino-to-android-turning-led-on-and.html
http://www.intorobotics.com/how-to-develop-simple-bluetooth-android-application-to-control-a-robot-remote/  

Best link for android DB operations update happens based on the unique_id(auto inc) used in DB
http://chintankhetiya.wordpress.com/2013/06/01/sqlite-database-example/comment-page-1/#comment-614 
Check google site too


Best link on db information android
http://androidshortnotes.blogspot.in/2013/03/store-data-in-android.html
 
Best link on db information android
http://androidsolution4u.blogspot.in/2013/09/android-populate-listview-from-sqlite.html

Best link to check whether android device has BLE (Bluetooth Low Energy)support or not 
http://weimenglee.blogspot.in/2013/10/check-if-your-android-device-supports.html

Blog
http://www.compiletimeerror.com/search/label/Android%20Basics#.VIFpqmL0xQL

Avoid Out Of Memory Error BitMap
http://stackoverflow.com/questions/15377186/decode-file-from-sdcard-android-to-avoid-out-of-memory-error-due-to-large-bitmap

http://www.php-intro.com/software-mac-xampp.php

Execute Robotium Test Cases in specific order
http://www.androiddevelopersolutions.com/2014/03/android-robotium-run-robotium-tests-in.html


Tab layout Material Design
http://www.androidhive.info/2015/09/android-material-design-working-with-tabs/


Espresso Links Android


http://evgenii.com/blog/testing-activity-in-android-studio-tutorial-part-3/

http://blog.sqisland.com/2015/04/espresso-custom-idling-resource.html

http://blog.novatec-gmbh.de/mobile-testing-espresso-framework/

https://androidresearch.wordpress.com/2015/04/04/an-introduction-to-espresso/

https://mayojava.github.io/android/android-ui-instrumentation-test-with-espresso/

Junit Parameterized Test


http://www.java2s.com/Tutorials/Java/JUnit/0140__JUnit_Parameterized_Test.htm

Jenkins


http://www.everybodytests.com/2015/04/jenkins-devices-androidjunitrunner.html

https://www.cloudbees.com/sites/default/files/2014-0625-Berlin-Christopher_Orr-Build_Test_Deploy_w-Android.pdf

Best Java and Android Blogs
https://mindorks.com/blogs
https://javaradar.blogspot.in/2017/03/class-variable-vs-instance-variable-in.html
http://wiki.workassis.com/android-how-to-set-a-ripple-effect/

Android native scripting
http://docs.nativescript.org/tutorial/chapter-1
https://docs.nativescript.org/angular/integration-with-existing-ios-and-android-apps/extend-existing-android-app-with-ns-angular2.html

BestLinks forCalendar Apps

https://github.com/luvyouso/CalendarGoogle2016
https://github.com/khacpv/Calendar-Day-View/blob/master/README.md
https://github.com/AnilMH/Android-WeekView-Demo

Drag n Drop
http://stackoverflow.com/questions/16990247/drag-and-drop-persistent-location

Drag n Drop in GridView
https://blahti.wordpress.com/2011/10/03/drag-drop-for-android-gridview/


Constrained Drop and Drag

https://github.com/rfreedman/android-constrained-drag-and-drop-view

Service and handler for long running asks
http://gradlewhy.ghost.io/a-service-and-a-handler-for-long-tasks/

MVC and MVP and MVVM
http://www.tothenew.com/blog/androidmvc-mvp-mvvm/

RxJava Android Learning
https://code.tutsplus.com/tutorials/getting-started-with-rxjava-20-for-android--cms-28345
https://code.tutsplus.com/tutorials/reactive-programming-operators-in-rxjava-20--cms-28396?_ga=2.197046314.723429276.1502526034-1015877821.1497434847
https://code.tutsplus.com/tutorials/rxjava-for-android-apps-introducing-rxbinding-and-rxlifecycle--cms-28565?_ga=2.125428746.1281241990.1512099718-1264555618.1502875086

Ios Learning Links

Good Blogs




Good links these are during the POC which I was working for FCM registration , IAP and Uploading image to IAP



https://spring.io/guides/gs/rest-service/#scratch


https://dzone.com/articles/build-rest-web-service-using-spring


https://code.tutsplus.com/tutorials/android-from-scratch-using-rest-apis--cms-27117


https://androidjson.com/capture-image-camera-upload-server/
https://www.callicoder.com/spring-boot-file-upload-download-rest-api-example/
http://zetcode.com/springboot/uploadfile/
https://www.mkyong.com/spring-mvc/spring-mvc-file-upload-example/
https://www.mkyong.com/spring-boot/spring-boot-file-upload-example-ajax-and-rest/




https://stackoverflow.com/questions/37516589/send-push-notifications-from-server-with-fcm
https://medium.com/@srinuraop/sending-messages-from-app-server-to-clients-using-fcm-b2a471fc3e33
https://www.zoftino.com/sending-device-specific-push-notification-message-using-firebase-cloud-messaging

https://www.myflashlabs.com/send-fcm-messages-server/


https://dzone.com/articles/spring-boot-restful-web-service-complete-example


https://www.callicoder.com/spring-boot-file-upload-download-rest-api-example/
https://www.17od.com/2010/02/18/multipart-form-upload-on-android/

https://learnwithmehere.blogspot.com/2015/10/is-multipart-request-complicated-think.html

https://stackoverflow.com/questions/35839130/send-file-and-parameters-to-server-with-httpurlconnection-in-android-api-23

https://demonuts.com/upload-image-to-server-in-android-using-multipart-volley/

https://stackoverflow.com/questions/11766878/sending-files-using-post-with-httpurlconnection


Pass a HashMap from Angular Client to Spring boot API

This example is for the case where fileData is very huge and in json format   let map = new Map<string, string>()      map.set(this.ge...