Hessian Web Service and Android App

by SteleFreak » Thu, 30 Apr 2009 17:55:38 GMT


Sponsored Links
 I have build a simple tapestry web application and set up hessian web
service within the servlet and when I access it from pc client it
works fine.

I want to access this service using hessian on Android but I can't
find a proper way to include hessian library(and any other third party
jar) in eclipse project so that it works during runtime. I have
browsed the web for like 2 last weeks, and googled and googled but all
solutions that I found were just not working! :(

Please Help!

I know this is basic stuff, and 90% of you guys know how to do this,
so help please :)
So my basic question is:

How to properly include third party jar in my android application so
that it works not only during compile time but also during runtime :)
Awaiting response eagerly :)
--~--~---------~--~----~------------~-------~--~----~



Hessian Web Service and Android App

by SteleFreak » Thu, 30 Apr 2009 18:53:37 GMT


 I tried to import hessian source into my project, but i see that this
library uses javax.naming and other packages from standard java sdk
which are not included in android sdk, so i guess this will not work.
Any ideas or suggestions? Do you know of some web service api library
that is working on Android without any modifications?



--~--~---------~--~----~------------~-------~--~----~


Sponsored Links


Other Threads

1. March 11th, 6-8 pm Mass GTUG meeting - Android Development - Developer Perspective

If you live in Boston greater area, you are welcome to join the local
chapter of GTUG http://massgtug.gtugs.org for Android themed meeting.

Luke Hutchinson and Greg Milette who are both Android developers will
provide the API overview and share their experience in mobile
development.

The meeting is scheduled for this Thursday, March 11th at 6 pm. This
event will be in Google Cambridge Office (conference room "Beacon
Hill" on the 3rd floor). Additional meeting details and registration
information can be found here: http://massgtug.gtugs.org/news/march2010-meeting

Monika Adamczyk
Mass GTUG organizer

-- MACO TECH INC
-- http://www.maco-tech.com
-- mon...@maco-tech.com
-- 781-816-9817
-- Twitter @macotech

-- 

2. Help me to select some days from a calendar base on some dates that I have please

I am working to an aplication who calculate the menstruation of girls.

input:  a calendar
          - start_day(the start day of menstrual cycle wich is with
red in the calendar )
          - end_day(the end day of menstrual cycle wich is with yellow
in the calendar)
           - mens(menstruation length)


output(what I want to optain):

                          I want to display on the calendar the
start(red background) and the end(yellow background) of menstruation
for the next 6 month. I manage to do this for 2 months and im block
now.

PLEASE IF SOMEONE  HAVE ANY IDEA!! Thank you verry much!

        Catalin







code for calendar: ShowCalendar.java:



                            public class ShowCalendar extends Activity
{
    public static final String selectedDate="selectedDate";
    public int mYear;
    public int mMonth;
    public int mDay;
    static int realDay, realMonth, realYear, currentMonth,
currentYear;
    private Enumeration<Girl.Period> e;
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.calendar);
        GregorianCalendar cal = new GregorianCalendar(); //Create
calendar
        realDay = cal.get(GregorianCalendar.DAY_OF_MONTH); //Get day
        realMonth = cal.get(GregorianCalendar.MONTH); //Get month
        realYear = cal.get(GregorianCalendar.YEAR); //Get year
        currentMonth=realMonth;
        currentYear=realYear;

            TextView t1=(TextView) findViewById(R.id.t1);
            TextView t2=(TextView) findViewById(R.id.t2);
            TextView t3=(TextView) findViewById(R.id.t3);
            TextView t4=(TextView) findViewById(R.id.t4);
            TextView t5=(TextView) findViewById(R.id.t5);
            TextView t6=(TextView) findViewById(R.id.t6);
            TextView t7=(TextView) findViewById(R.id.t7);
            TextView t8=(TextView) findViewById(R.id.t8);
            TextView t9=(TextView) findViewById(R.id.t9);
            TextView t10=(TextView) findViewById(R.id.t10);
            TextView t11=(TextView) findViewById(R.id.t11);
            TextView t12=(TextView) findViewById(R.id.t12);
            TextView t13=(TextView) findViewById(R.id.t13);
            TextView t14=(TextView) findViewById(R.id.t14);
            TextView t15=(TextView) findViewById(R.id.t15);
            TextView t16=(TextView) findViewById(R.id.t16);
            TextView t17=(TextView) findViewById(R.id.t17);
            TextView t18=(TextView) findViewById(R.id.t18);
            TextView t19=(TextView) findViewById(R.id.t19);
            TextView t20=(TextView) findViewById(R.id.t20);
            TextView t21=(TextView) findViewById(R.id.t21);
            TextView t22=(TextView) findViewById(R.id.t22);
            TextView t23=(TextView) findViewById(R.id.t23);
            TextView t24=(TextView) findViewById(R.id.t24);
            TextView t25=(TextView) findViewById(R.id.t25);
            TextView t26=(TextView) findViewById(R.id.t26);
            TextView t27=(TextView) findViewById(R.id.t27);
            TextView t28=(TextView) findViewById(R.id.t28);
            TextView t29=(TextView) findViewById(R.id.t29);
            TextView t30=(TextView) findViewById(R.id.t30);
            TextView t31=(TextView) findViewById(R.id.t31);
            TextView t32=(TextView) findViewById(R.id.t32);
            TextView t33=(TextView) findViewById(R.id.t33);
            TextView t34=(TextView) findViewById(R.id.t34);
            TextView t35=(TextView) findViewById(R.id.t35);
            TextView t36=(TextView) findViewById(R.id.t36);
            TextView t37=(TextView) findViewById(R.id.t37);
            TextView t38=(TextView) findViewById(R.id.t38);
            TextView t39=(TextView) findViewById(R.id.t39);
            TextView t40=(TextView) findViewById(R.id.t40);
            TextView t41=(TextView) findViewById(R.id.t41);
            TextView t42=(TextView) findViewById(R.id.t42);

        TextView[][] a=new TextView[][]{{t1,t2,t3,t4,t5,t6,t7},
{t8,t9,t10,t11,t12,t13,t14},{t15,t16,t17,t18,t19,t20,t21},
{t22,t23,t24,t25,t26,t27,t28},{t29,t30,t31,t32,t33,t34,t35},
{t36,t37,t38,t39,t40,t41,t42}};

        refreshCalendar(realMonth,realYear,a);

    }
    public void refreshCalendar(int month,int year,final TextView[][]
a){
        Girl aGirl=null;
        //Variables
        String[] months = {"January", "February", "March", "April",
"May", "June", "July", "August", "September", "October", "November",
"December"};
        int nod, som, mom;
        //Get number of days and start of month
        GregorianCalendar cal2 = new GregorianCalendar(year, month,
7);
        nod = cal2.getActualMaximum(GregorianCalendar.DAY_OF_MONTH);
        som = cal2.get(GregorianCalendar.DAY_OF_WEEK);
        mom= cal2.get(GregorianCalendar.MONTH);
        int row;
        int column;

        TextView monthYear=(TextView) findViewById(R.id.month);
        TextView average=(TextView) findViewById(R.id.mens_red);

        Bundle extras = getIntent().getExtras();
        if(extras !=null){
            final int id = extras.getInt("id");
            SqLiteGirlList g = SqLiteGirlList.getInstance();
            aGirl = g.get(id);

            e = aGirl.getPeriods();
        }
         //clear table
        for (int i=0;i<6;i++){
            for (int j=0;j<7;j++){
                a[i][j].setText(null);
            }
        }
        //Draw calendar
        for (int i=1; i<=nod; i++){
            row = (i + som - 2) / 7;
            column  =  (i+som-2)%7;
            if(i<10)
                a[row][column].setText(i+"");
            else
                a[row][column].setText(i+"");
        }

        Button back=(Button) findViewById(R.id.back);
        Button forward=(Button) findViewById(R.id.forward);
        //Allow/disallow buttons
        if (month == 0 && year <= realYear-100)
{back.setEnabled(false);} //Too early
        if (month == 11 && year >= realYear+100)
{forward.setEnabled(false);} //Too late
        monthYear.setText(months[month]+" "+year);


        //System.out.println("outside");

            //System.out.println("inside");
            Girl.Period p=e.nextElement();
            String start_day_m, end_day_m,  end_day;
            Date d=p.getPeriodStart() ;
            int end_day_m1, end_day_m2;
            int start_day_m1, start_day_m2;
            long milPerDay = 1000*60*60*24;
            int mens = p.getMenstruation() ;//menstruation length
            int mens1= mens-1;
            long length_cycle = p.calcDif(p.getPeriodStart() ,
p.getPeriodEnd() ) ;
            long sumMC= mens+length_cycle;


             //System.out.println("insideeemens"+ sumMC);
             //System.out.println("insideee"+ ss/milPerDay);

             // start_day_m is the first day of bleeding in the first
month
               start_day_m=String.valueOf(d.getDate());
              // System.out.println("insideeestart"+ start_day_m);

              // end_day_m is the last day of bleeding in the first
month
               end_day_m = String.valueOf(d.getDay()+ mens1);
              // System.out.println("insideeend"+ end_day_m);





            Date d3=null;
            if(p.getPeriodEnd()!=null){
                d3=p.getPeriodEnd() ;
                start_day_m1=d3.getDate()+1;
            }
            else
                start_day_m1=0;

                end_day_m1=start_day_m1+mens-1;
                int end_day_mm1= end_day_m1;

            if(end_day_m1>nod ){
                d3=p.getPeriodEnd() ;
                end_day_m1-=nod+1;

            }else if(end_day_mm1<nod){
                d3=p.getPeriodEnd() ;
                end_day_mm1=start_day_m1+mens-1;
            }








            //
System.out.println("------------------------------------------------------------------------------------");
            for(int i=0;i<6;i++){
                for(int j=0;j<7;j++){
                    a[i][j].setBackgroundResource(R.color.gray);
                    //System.out.println("Start month &
year="+monthYear.getText().toString()+" Start day="+a[i]
[j].getText());
                    //System.out.println("comp with year="+(d.getYear()
+1900)+" month="+months[d.getMonth()]+" day="+start_day);
                   //-----------------------------------------month1
its
ok-----------------------------------------------------------------
 
if(monthYear.getText().toString().indexOf(String.valueOf(d.getYear()
+1900))>-1 &&
monthYear.getText().toString().indexOf(months[d.getMonth()])>-1 && a[i]
[j].getText().equals(String.valueOf(start_day_m))){
                        a[i][j].setBackgroundResource(R.color.red) ;
                     System.out.println("arayStart"+ a[i][j]);
                    }
 
if(monthYear.getText().toString().indexOf(String.valueOf(d.getYear()
+1900))>-1 &&
monthYear.getText().toString().indexOf(months[d.getMonth()])>-1 && a[i]
[j].getText().equals(String.valueOf(end_day_m))){
                       a[i][j].setBackgroundResource(R.color.yellow) ;
                        //System.out.println("arayEnd"+ a[i][j]);
                        //System.out.println("startMatch");
                    }


                    //-----------------------------------------month2
its
ok-----------------------------------------------------------------
                    //System.out.println("End month &
year="+monthYear.getText().toString()+" End day="+a[i][j].getText());
                    //System.out.println("comp with year="+
(d2.getYear()+1900)+" month="+months[d2.getMonth()]+" day="+end_day);

 
if(monthYear.getText().toString().indexOf(String.valueOf(d3.getYear()
+1900))>-1 &&
monthYear.getText().toString().indexOf(months[d3.getMonth()])>-1 &&
a[i][j].getText().equals(String.valueOf(start_day_m1))){
                          a[i][j].setBackgroundResource(R.color.red) ;
                           //System.out.println("endMatch");
                        }
 
if(monthYear.getText().toString().indexOf(String.valueOf(d3.getYear()
+1900))>-1 &&
monthYear.getText().toString().indexOf(months[d3.getMonth()])>-1 &&
a[i][j].getText().equals(String.valueOf(end_day_mm1))){
                           a[i]
[j].setBackgroundResource(R.color.yellow);
                        }
 
if(monthYear.getText().toString().indexOf(String.valueOf(d3.getYear()
+1900))>-1 &&
monthYear.getText().toString().indexOf(months[d3.getMonth()+1])>-1 &&
a[i][j].getText().equals(String.valueOf(end_day_m1))){
                           a[i]
[j].setBackgroundResource(R.color.yellow);
                        }
                     //-----------------------------------------
month3-----------------------------------------------------------------



                    //
System.out.println("------------------------------------------------------------------------------------");

            }
            }


        back.setOnClickListener(new Button.OnClickListener(){
            public void onClick(View v){
                if (currentMonth == 0){ //Back one year
                currentMonth = 11;
                currentYear -= 1;
                }
                else{ //Back one month
                    currentMonth -= 1;
                }
                refreshCalendar(currentMonth, currentYear,a);
            }
        });
        forward.setOnClickListener(new Button.OnClickListener(){
            public void onClick(View v){
                if (currentMonth == 11){ //Forward one year
                currentMonth = 0;
                currentYear += 1;
                }
                else{ //Forward one month
                    currentMonth += 1;
                }
                refreshCalendar(currentMonth, currentYear,a);
            }
        });


    }
}

-- 

3. Animations between Intents ?

4. Trying to create a simple layout with image and 2 buttons

5. Android themes and styles

6. Android Application Review Site

7. How to use pdfbox to read pdf file on android?