[android-beginners] hi
HI I bought china one white apple iphone 3gs from this I have received product! w e b:hotrademe.com You can check it! Hope all is going well for you I hope you can enjoy it for shopping, Thank you! -- You received this message because you are subscribed to the Google Groups "Android Beginners" group. NEW! Try asking and tagging your question on Stack Overflow at http://stackoverflow.com/questions/tagged/android To unsubscribe from this group, send email to android-beginners+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en
[android-beginners] ListView onListItemClick
Hi, I am creating an application which parses an XML from the web and displays the items of a tag in another ListView. Basically i want to know an effecient way of using ListView all throughout the application. Ex: Part 1 Part 2Part 3 My Bookshelf -Click->Opens another ListView >Book 1--- > Click--> ListView->First Page Options Book 2 Help Exit I am able to go from part 1 to part 2. but not from part 2 to part3. I might be doing some mistake in part 1 to part 2 itself. Please advise. I am very confused and stuck. My code: package com.vijay.MogoMenu; import java.io.IOException; import java.io.InputStream; import java.net.HttpURLConnection; import java.net.URL; import java.net.URLConnection; import java.util.ArrayList; import javax.xml.parsers.DocumentBuilder; import javax.xml.parsers.DocumentBuilderFactory; import javax.xml.parsers.ParserConfigurationException; import org.w3c.dom.Document; import org.w3c.dom.Element; import org.w3c.dom.Node; import org.w3c.dom.NodeList; import org.xml.sax.SAXException; import android.app.ListActivity; import android.os.Bundle; import android.view.View; import android.widget.AdapterView; import android.widget.ArrayAdapter; public class MogoMenu extends ListActivity { ArrayList linksArray = new ArrayList(); ArrayList itemsArray = new ArrayList(); /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setListAdapter(new ArrayAdapter (this,android.R.layout.simple_list_item_1, MENU_NAMES)); } private static final String[] MENU_NAMES = new String[] { "My Bookshelf", "On the Go", "Options", "Help", }; public void onItemClick(AdapterView parent, View v, int position, long id) { // Pre-load the image then start the animation System.out.println("On Item Click" +position); if(position == 0) { DownloadRSS("http://xmlgwdev.lotusbookworks.com/? acctid=0bfHgPce7k:Hiw6hsB4fx&listID=1"); } else if(position == 3) { setContentView(R.layout.help); } } public void onClick(View v) { System.out.println("On View Click"); } public InputStream OpenHttpConnection(String urlString) throws IOException { InputStream in = null; int response = -1; URL url = new URL(urlString); URLConnection conn = url.openConnection(); System.out.println("Opening Connection"); if (!(conn instanceof HttpURLConnection)) throw new IOException("Not an HTTP connection"); try { System.out.println("Obtaining CONNECTION"); HttpURLConnection httpConn = (HttpURLConnection) conn; httpConn.setAllowUserInteraction(false); httpConn.setInstanceFollowRedirects(true); httpConn.setRequestMethod("GET"); System.out.println("Connecting"); httpConn.connect(); response = httpConn.getResponseCode(); if (response == HttpURLConnection.HTTP_OK) { System.out.println("SUPER CONNECTION"); in = httpConn.getInputStream(); System.out.println("Bitmap puttin into IMG1"); } } catch (Exception ex) { throw new IOException("Error connecting"); } return in; } /*Download XML RSS feed*/ @SuppressWarnings("unchecked") private void DownloadRSS(String URL) { InputStream in = null; try { in = OpenHttpConnection(URL); Document doc = null; DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); DocumentBuilder db; try { db = dbf.newDocumentBuilder(); doc = db.parse(in); } catch (ParserConfigurationException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (SAXException e) { // TODO Auto-generated catch block e.printStackTrace(); } doc.getDocumentElement().normalize(); itemsArray.clear(); linksArray.clear(); String strTitle = null; String strLink = null; NodeList itemNodesList = doc.getElementsByTagName("a"); for (int i = 0; i < itemNodesList.getLength(); i++) { Node itemNode = itemNodesList.item(i); if (itemNode.getNodeType() == Node.ELEMENT_NODE) { //---convert the Node into an Element--- Element itemElement = (Element) itemNode; //---get all the TITLES element under the NodeL
[android-beginners] Newbie doubt here! Please advise.
Hi, I just started programmind an application using Eclipse for Android. I am creating 2 screens. 1st screen: Has a text and a button which onClick --> takes you to the 2nd screen. 2nd screen: Has a text and a button which onClick -- > takes you to the 1st screen. just like NEXT and BACK. But somehow i keep getting "Application Simple application has stopped unexpectedly." Force Close. My code:Simple.java package com.vijay.simple; import android.app.Activity; import android.os.Bundle; import android.view.View; import android.view.View.OnClickListener; import android.widget.Button; public class Simple extends Activity { /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); Button b1 = (Button) findViewById(R.id.button_id1); b1.setOnClickListener(buttonListener1); Button b2 = (Button) findViewById(R.id.button_id2); b2.setOnClickListener(buttonListener2); } private OnClickListener buttonListener1 = new OnClickListener(){ public void onClick(View v1){ setContentView(R.layout.main_2); } }; private OnClickListener buttonListener2 = new OnClickListener(){ public void onClick(View v2){ setContentView(R.layout.main); } }; } --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Android Beginners" group. To post to this group, send email to android-beginners@googlegroups.com To unsubscribe from this group, send email to android-beginners-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en -~--~~~~--~~--~--~---
[android-beginners] Re: Confusion about selection
can anyone tel me how to select row or get row index... and also displaying two rows in one TableRow final private String[] mKeys = {"Goog", "432", "-23% (-10.15)", "IBM", "15", "60% (6.2)", "INTC", "28", "12% (2.15)", "DELL", "80", "34% (42.15)","Goog", "432", "-23% (-10.15)", "IBM", "15", "60% (6.2)", "INTC", "28", "12% (2.15)", "DELL", "80", "34% (42.15)","Goog", "432", "-23% (-10.15)", "IBM", "15", "60% (6.2)", "INTC", "28", "12% (2.15)", "DELL", "80", "34% (42.15)","Goog", "432", "-23% (-10.15)", "IBM", "15", "60% (6.2)", "INTC", "28", "12% (2.15)", "DELL", "80", "34% (42.15)"}; TableLayout tl = (TableLayout)findViewById(R.id.portfolio); tl.setColumnStretchable (2,true); tl.setFocusable(true); tl.setFocusableInTouchMode(true); tl.setSoundEffectsEnabled(true); tl.setSelected(true); //tl.setOnFocusChangeListener(new ) /* Create a new row to be added. */ for(int row = 0; row < 16; row++) { tr = new TableRow(this); tl.addView(tr); tr.setFocusableInTouchMode(true); tr.setFocusable(true); tr.findViewById(row); tr.setMinimumHeight(30); if(row%2==0) tr.setBackgroundColor(Color.TRANSPARENT); else { tr.setBackgroundColor (Color.WHITE); } // tr.layout(l, t, r, b) for (int col=0; col<4; col++) { TextView label = new TextView(this); //label.setBackgroundResource(R.drawable.buy_gain); if(col==0) { label.setText(mKeys[row*3+col]); label.setPadding(5, 5, 15, 10); label.setGravity(120); tr.addView(label); }else if(col==1) { ImageView icon = new ImageView(this); icon.setImageResource(R.drawable.buy_loss); icon.setPadding(0, 10, 25, 10); tr.addView(icon); }else{ label.setText(mKeys[row*3+(col-1)]); label.setPadding(10, 10, 45, 10); label.setGravity(120); tr.addView(label); } } } On Wed, Jan 7, 2009 at 6:34 PM, silverberg.ode...@googlemail.com < silverberg.ode...@googlemail.com> wrote: > > Well it depends imho. If you have no programming experience with, it's > better to start with java/j2me first. > Experience with j2me of course helps much when it comes to the > security model of mobile devices, as it's quite different from > classical java or desktop programming. > > Guess if you're experienced programmer, you can skip the j2me part > > On Jan 6, 5:13 am, "Pratik Patel" wrote: > > Hi, > > > > WHICH I SHOULD LEARN FIRST j2me or android. Give ur vote pls to identify > > what to learn. > > > > I have just started Android development but after reading starting > concepts > > I am confused about selection. Whether I should learn J2ME first and > > > > Then android because Android requires JAVA. Which should I learn first ? > > Because it will be same to learn both then I should start with j2me > because > > > > Atleast I will have java knowledge when I will start android. > > > > Please reply me to identify. > > > > Thanks and Regads, > > > > Pratik Patel > > > > Sr. Software Engineer > > > > C-SAM > > > > www.c-sam.com > > > > email: pratik.pa...@c-sam.com <mailto:swati.o...@c-sam.com> > > + 91 265 2324018/19 (O) > > + 91 265 2334156 (F) > > > -- Regds Vijay Ph: 91-9940187004 --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Android Beginners" group. To post to this group, send email to android-beginners@googlegroups.com To unsubscribe from this group, send email to android-beginners-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en -~--~~~~--~~--~--~---
[android-beginners] Setting Custom layout for ListView
ListActivity has a default layout and when i create a new custom layout like below, it gives an error. "The application stopped unexpectedly". http://schemas.android.com/apk/res/ android" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent"> it goes out of debugger and gives error when it comes to the line setContentView(R.layout.custom_layout). When i comment this line it displays a List. How to create a custom ListView? Any help will be appreciated. Thanks!!! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Android Beginners" group. To post to this group, send email to android-beginners@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en -~--~~~~--~~--~--~---