Any android developers or java heads?
Register
Results 1 to 2 of 2
  1. #1
    V.I.P. Member haribo's Avatar
    Join Date
    Jun 2008
    Location
    in my car
    Posts
    914
    Thanks Thanks Given 
    3
    Thanks Thanks Received 
    2
    Thanked in
    2 Posts

    Default Any android developers or java heads?

    Looking a little help with someone in the know.
    Im currently learning my way around the android SDK.
    I have an idea for an app I want to make for my work, but have no idea if this API is capable of outputting data to .CVS format for import into a xmls spreadsheet?
    anyone have an idea?
    basically i have made simple screen with drop down, select the centre, enter you mileage and eventually it will get procesed to my expenses spreadsheet. anyone got some java experiance?

  2. #2
    DK Veteran Bann32's Avatar
    Join Date
    Oct 2011
    Location
    Northwest
    Posts
    522
    Thanks Thanks Given 
    6
    Thanks Thanks Received 
    8
    Thanked in
    8 Posts

    Default

    What you want to do shouldn't be that difficult. Its been years since I did java and I haven't compiled this code but basically its something like

    Code:
    
    public static void main(String args[]) {
                    System.out.println("Enter your Centre: ");
                    String centre = input.nextLine();
    		 System.out.println("Enter your mileage : ");
    		 String milage = input.nextline();
    		  
    	try
    	{
    	    FileWriter writer = new FileWriter("C:\\test.csv");
    	    writer.append(distance);
                 writer.append(",);
    	    writer.append(milage);
    	    writer.append("/r/n"): //end of line flag
    	
    	     writer.flush();
    	      writer.close();
    	}
    		catch(IOException e)
    	{
    	}
    But as you wanted a drop down menu you need to create a combobox

    Code:
    String[] centreStrings = { "aaa", "bbb", "ccc", "ddd", "eee" };
    JComboBox centreList = new JComboBox(centreStrings);
    //can't edit the options it must be in the list
    centreList.setEditable(false);
    centreList.setSelectedIndex(0); //to select top of list "aaa"
    There is a bit missing an actionlistener on the combo box but these bits and bats should put you in right direction at least.

    Why do you want to do it in java though? and if I am well off I am sure someone will put it right

 

 

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •