[android-developers] Injecting Events into Webview

2018-04-01 Thread Dancing Fingers
I have Cerebral palsy and my favorite online game has some really small 
buttons. I was trying to see if I could put the game in a webview and surround 
it by larger buttons that inject events into the game. No luck yet.

Any thoughts?

Chris

-- 
You received this message because you are subscribed to the Google Groups 
"Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
To post to this group, send email to android-developers@googlegroups.com.
Visit this group at https://groups.google.com/group/android-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/android-developers/94f8bf32-290e-4c12-bc60-31427de4d423%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[android-developers] Re: Advanced Touch Control: passing touch event from one view to another

2013-04-06 Thread Dancing Fingers
Why can't you just declare an Application variable and pass it back and 
forth that way?

-- 
-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
Android Developers group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[android-developers] Re: How Can I pass an ArrayList do another Activity?

2012-09-05 Thread Dancing Fingers
I've passed very complex ArrayList via Application class.
Chris

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

[android-developers] Re: How to create Hexagon in android ?

2012-09-03 Thread Dancing Fingers
Been there, done that, pretty sure you can't do it in TextView unless you 
use Path over an image Button.  I used a Canvas and drew it.

Chris

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

[android-developers] Re: How to create Hexagon in android ?

2012-09-03 Thread Dancing Fingers

How do you get the corners not to be clickable?   That was my problem.  I 
created a whole keyboard of Hexagons.
Chris

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

[android-developers] Opengl on Toshiba Qosmio X775?

2012-08-03 Thread Dancing Fingers
Hi guys,
I've played around with OpenGL on Android and I plan to pursue it further.  
I need a new laptop so I'm considering the 3D Toshiba Qosmio X775.  Does 
anyone know if OpenGL will work on the new 3D laptops?
Thanks.
Chris

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

[android-developers] Combining a Business and Gaming App

2012-06-11 Thread Dancing Fingers
Hi Guys,
Does anyone know of an example where you combine a gaming canvas in 2/3 of 
the screen and the top is more of an standard xml type layout, to have 
scores, other online users, etc.  I figured out 1 way but I was wondering 
what others have done.
Thanks.
Chris

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

[android-developers] Can you Determine the x,y Coordinates of a Character in TextView?

2012-04-11 Thread Dancing Fingers
Hi guys,
I'm finishing up my app that's a custom keyboard for Android.  I'm using 
TextView because it doesn't have a default keyboard and it seem to work 
better in FrameLayout.  I'm toying with the idea of having text appear to 
fly in the TextView widget.  I figure if I know the font width, height and 
row of text I could do it.  Has anyone ever tried this?
Thanks.
Chris

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

[android-developers] Re: EditText not Accepting Soft Keyboard Input from Supporting Activity

2012-03-07 Thread Dancing Fingers
Does anyone know how to debug the soft keyboard and identify what
widget it's targeting?

Thanks.

Chris

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] EditText not Accepting Soft Keyboard Input from Supporting Activity

2012-03-06 Thread Dancing Fingers
Hi guys,
My default activity is a game so I didn't include Soft Keyboard dialog
in this activity.  One feature of my app is to email game results to
friends in a supporting activity.  This activity has several EditText
widgets but it gets stuck in the first email/textedit widget.  The
widget appears in focus and the Soft Keyboard appears but the widget
doesn't accept input and the keyboard acts like it's in slow motion.
Here's my layout:

?xml version=1.0 encoding=utf-8?
LinearLayout xmlns:android=http://schemas.android.com/apk/res/
android
android:layout_width=fill_parent
android:layout_height=fill_parent
android:gravity=center_horizontal
android:orientation=vertical 

TextView
android:id=@+id/textView1
android:layout_width=214dp
android:layout_height=wrap_content
android:layout_gravity=center_horizontal
android:text=Large Text
android:textAppearance=?android:attr/textAppearanceLarge
android:textSize=24dp
android:textStyle=bold /

LinearLayout
android:id=@+id/emailLayout
android:layout_width=fill_parent
android:layout_height=wrap_content 

TextView
android:id=@+id/textView2
android:layout_width=wrap_content
android:layout_height=wrap_content
android:gravity=right
android:layout_weight=20
android:text=Email Address:
android:textAppearance=?android:attr/
textAppearanceMedium /

EditText
android:id=@+id/emailText
android:layout_width=wrap_content
android:layout_height=wrap_content
android:layout_weight=80
android:windowSoftInputMode=stateVisible
android:inputType=textEmailAddress
android:singleLine=true 
/EditText
/LinearLayout

LinearLayout
android:id=@+id/subjectLayout
android:layout_width=fill_parent
android:layout_height=wrap_content 

TextView
android:id=@+id/textView3
android:layout_width=wrap_content
android:layout_height=wrap_content
android:gravity=right
android:layout_weight=20
android:text=Subject:
android:textAppearance=?android:attr/
textAppearanceMedium /

EditText
android:id=@+id/subjectText
android:layout_width=wrap_content
android:layout_height=wrap_content
android:windowSoftInputMode=stateVisible
android:layout_weight=80
android:inputType=textEmailAddress|textEmailSubject
android:singleLine=true /
/LinearLayout


EditText
android:id=@+id/mainText
android:layout_width=match_parent
android:layout_height=wrap_content
android:layout_weight=0.31 /

LinearLayout
android:id=@+id/buttonLayout
android:layout_width=match_parent
android:layout_height=wrap_content
android:gravity=center 

Button
android:id=@+id/sendButton
android:layout_width=wrap_content
android:layout_height=wrap_content
android:text=Send /
Button
android:id=@+id/clearButton
android:layout_width=wrap_content
android:layout_height=wrap_content
android:text=Clear /

/LinearLayout
/LinearLayout

Any ideas?

Thanks.

Chris

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Re: Reading and Writing xml file to Internal Memory

2012-02-28 Thread Dancing Fingers
Thanks.  I got it going.  The main problem was that my parser was not
using a ByteArray input stream.  Secondly, my Xml writer wasn't
generating clean XML.  It work now.  Here's what I got:


public void writeWordXmlFile() {
myWords = new ArrayListWord();
myWords.add(new Word(Diversability));
myWords.add(new Word(Theate));

try {
FileOutputStream fos = openFileOutput(mywords.xml,
Context.MODE_PRIVATE);
XmlSerializer serializer = Xml.newSerializer();
serializer.setOutput(fos, UTF-8);
serializer.startTag(, Words);

for( int i=0; imyWords.size(); i++) {
serializer.startTag(, WordPair);
serializer.startTag(, word);
serializer.text(myWords.get(i).getWord());
serializer.endTag(, word);
serializer.startTag(, count);

serializer.text(Integer.toString(myWords.get(i).getCount()));
serializer.endTag(, count);
serializer.endTag(, WordPair);
}
serializer.endTag(, Words);
serializer.endDocument();
serializer.flush();
fos.close();
System.out.println(mywords.xml file written.);
} catch (IOException e) {
System.out.println(e);
}

}

public void parseMyWordXmlFile() {
myWords = new ArrayListWord();
Word wWd;
String sIn;

try {
System.out.println(Reading mywords.xml);
SAXParserFactory factory = 
SAXParserFactory.newInstance();
SAXParser saxParser = factory.newSAXParser();
DefaultHandler handler = new DefaultHandler() {
boolean gotWord = false;
boolean gotCount = false;

public void startElement(String uri, String localName,
String qName, Attributes attributes)
throws SAXException {

System.out.println(Start Element : + qName);
if (qName.equalsIgnoreCase(word)) {
gotWord = true;
}
if (qName.equalsIgnoreCase(count)) {
gotCount = true;
}
}

public void endElement(String uri, String localName,
String qName) throws SAXException {
System.out.println(End Element : + qName);
}

public void characters(char ch[], int start, int length)
throws SAXException {
System.out.println(new String(ch, start, 
length));

if (gotWord) {
System.out.println(word :  + new 
String(ch, start,
length));
gotWord = false;
}

if (gotCount) {
System.out.println(Count :   + new 
String(ch, start,
length));
gotCount = false;
}
}
};

FileInputStream is =  openFileInput( mywords.xml);
byte[] byIn = new byte[is.available()];
while ( is.read(byIn) != -1 ){
System.out.println(new String (byIn));
}
InputStream inputStream = new ByteArrayInputStream( byIn );
Reader reader = new InputStreamReader(inputStream,UTF-8);
InputSource isrc = new InputSource(reader);
isrc.setEncoding(UTF-8);
saxParser.parse(isrc, handler);
is.close();

} catch (Exception e) {
e.printStackTrace();
}
}

Chris

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Reading and Writing xml file to Internal Memory

2012-02-27 Thread Dancing Fingers
Hi guys,
My app needs to learn user words and store them in XML files.  So I
wrote a test method:

public void writeWordXmlFile() {
myWords = new ArrayListWord();
myWords.add(new Word(Diversability));
myWords.add(new Word(Theate));

try {
FileOutputStream fos = new  
FileOutputStream(mywords.xml);
XmlSerializer serializer = Xml.newSerializer();
serializer.setOutput(fos, UTF-8);
serializer.startDocument(null,
Boolean.valueOf(true));
   //set indentation option
serializer.setFeature(http://xmlpull.org/v1/
doc/features.html#indent-output, true);
serializer.startTag(, Words);

for( int i=0; imyWords.size(); i++) {
serializer.startTag(, WordPair);

serializer.startTag(, word);
serializer.text(myWords.get(i).getWord());
serializer.endTag(, word);
serializer.startTag(, count);

serializer.text(Integer.toString(myWords.get(i).getCount()));
serializer.endTag(, count);

serializer.endTag(, WordPair);
}
serializer.endTag(, Words);
fos.close();
System.out.println(mywords.xml file written.);
} catch (IOException e) {
System.out.println(e);
}
}

This appears to work fine.  So I wrote a SAX Xml parser and I kept
getting a File Not Found exception.  So a wrote a simple file reader
method :

public void parseMyWordXmlFile() {
myWords = new ArrayListWord();
Word wHandler = new Word();
String sIn;
//create an InputSource from the XML document source
try {
System.out.println(Reading mywords.xml);
BufferedReader bin = new BufferedReader( new
FileReader( mywords.xml));
while ((sIn = bin.readLine()) != null){
System.out.println(sIn);
}
}  catch (Exception e) {
System.out.println(NOT Reading mywords.xml + e);
}
}

Again, I get a FileNotFound Exception.  Doesn't Android read and write
to the same path in internal memory?

Thanks.
Chris

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Nested listeners?

2012-02-22 Thread Dancing Fingers
I have a business style layout that sits on a custom/game layout.
Ideally I waneet each view/layout to have their respective listeners.
Has any one written a tutorial on nested listeners?
Thanks.
Chris

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Re: Application Object, Complex ArrayList's and memory?

2012-01-25 Thread Dancing Fingers
I think I found a gottcha for Developers of Ubuntu.  My son left his
Macbook at my house so I started using it for development.  The same
code that didn't work on Ubuntu 10.11 ran fine on the Mac.  The Mac
runs a lot faster even though the Linux box has 4 gigs of RAM.  May be
it's the JAVA implementation?
Chris

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Application Object, Complex ArrayList's and memory?

2012-01-18 Thread Dancing Fingers
Hi guys,
My app uses 4 ArrayLists which I want to be accessible to all
activities so I decided to load them into an Application object.
Three out of the 4 work fine but the forth won't work.  It's the
largest Arraylist and it also happens to be a complex Arraylist of
String, each Arraylist contains another Arraylist of Strings.  But
this complex ArrayList structure works fine with char's.

Has any one run into a memory limitation issue with the Application
object, or any issues with ArrayList's of strings?

 Free advice is appreciated.

Chris

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Re: Application Object, Complex ArrayList's and memory?

2012-01-18 Thread Dancing Fingers
The XML file is 3 Mb, although the data is probably less.  This runs a
word prediction routine.  May be I need to look at what I really
need.  I'll probably try reading the words as I need them and see how
much that slows me down.

Chris

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Re: Setting TabSpec Content using Source Code

2012-01-01 Thread Dancing Fingers
The obvious answer is to set the id manually: inputLayout.setId(1);

Chris

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Setting TabSpec Content using Source Code

2011-12-31 Thread Dancing Fingers
Hi Guys,
I've created a custom game keyboard that I want to share with several
windows so I decided to give TabActivity a try.  I created a layout
for each tab, for example:

// Plain text input layout
inputLayout = new LinearLayout(this);
inputLayout.setOrientation(LinearLayout.VERTICAL);
mainText.setHeight(120);
inputLayout.addView(mainText);
inputLayout.addView(keyboard);

host.addTab(host.newTabSpec(Text
Input).setIndicator(Input).setContent(inputLayout));

I get an change inputLayout to int compile error.  This seems
inconsistent with the Activity class.  Is there a workaround or do I
have to use xml?

Thanks.

Chris

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Re: Should I buy my own apps?

2011-12-10 Thread Dancing Fingers
So how do you demo, or show your friends your app on your own device?

Just  curious.

Chris

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Re: Populating Gallery dynamically with TextViews

2011-12-09 Thread Dancing Fingers
Valentin,
I'm not a professional but why are you monkeying around with the
manifest when what you want to  do is easily done in the code?

public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
layout = new LinearLayout(this);
layout.setOrientation(LinearLayout.VERTICAL);
KeyView key= new KeyView(this);

mainText = new TextView(this);
layout.addView(mainText);

layout.addView(key);

setContentView(layout);

Hopes this helps

Chris

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Re: XML DOM Parser works in JAVA, Crashes Android App, Now XMLPullParser

2011-10-01 Thread Dancing Fingers
I figured it out.  It was a combination of not accessing the correct
Android resources and faulty data structure.  The correct code follows
(hope this helps someone else):


public void parseCharXmlFile(){
Chars myCh;
String nameTag= ;

try {
Resources res = getResources();
int eventType = parser.getEventType();
boolean done = false;

while (eventType != XmlPullParser.END_DOCUMENT  !done 
){
switch (eventType){
case XmlPullParser.START_DOCUMENT:
chars.clear();
break;
case XmlPullParser.START_TAG:
nameTag = parser.getName();
System.out.println(Reading start tag  + 
nameTag);
if (nameTag.equalsIgnoreCase(ch) ) {
myCh = new Chars(' ',0);

myCh.setTheChar(parser.nextText().charAt(1));
}  else if 
(nameTag.equalsIgnoreCase(count)) {

myCh.setCount(Integer.parseInt(parser.nextText()));
}
 break;
case XmlPullParser.END_TAG:
nameTag = parser.getName();
if (nameTag.equalsIgnoreCase(Chars) ){
done = true;
} else if (nameTag.equalsIgnoreCase(ChPair))
{
chars.add(myCh);
}
break;
}  // event switch end
eventType = parser.next();
} // end while
} catch (XmlPullParserException ex) {
System.out.println(ex);
} catch (IOException e) {
System.out.println(e);
}
}

Chris

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] XML DOM Parser works in JAVA, Crashes Android App

2011-09-30 Thread Dancing Fingers
Hi Guys,
I'm trying to convert an old JAVA Applet to Android using an standard
DOM parser and the same files.  I put the file in /res/raw ( and
tried /res/xml) and changed my InputStream.  It always crashes my
app.  So I tried to run the debugger and it keeps openning some Delvic
type file and says source not found.  Huh?

Any thoughts would be appreciated.

Chris

private void parseCharXmlFile(){
Chars myCh;
try {
InputStream iStrm = 
getResources().openRawResource(R.xml.chars);
DocumentBuilderFactory docBuilderFactory =
DocumentBuilderFactory.newInstance();
DocumentBuilder docBuilder =
docBuilderFactory.newDocumentBuilder();
//Document doc = docBuilder.parse (new File(xFile));
Document doc = docBuilder.parse (iStrm);

// normalize text representation
doc.getDocumentElement ().normalize ();

NodeList wdList = doc.getElementsByTagName(ChPair);
int totalWords = wdList.getLength();

for(int s=0; swdList.getLength() ; s++){

Node firstWordNode = wdList.item(s);
if(firstWordNode.getNodeType() == Node.ELEMENT_NODE){

Element firstWordElement = (Element)firstWordNode;

myCh = new Chars();

//---
NodeList firstWordList =
firstWordElement.getElementsByTagName(ch);
Element firstWDElement = 
(Element)firstWordList.item(0);

NodeList textWDList = 
firstWDElement.getChildNodes();
char ci =
(char)textWDList.item(0).getNodeValue().trim().charAt(1);
myCh.setTheChar(ci);

//---
NodeList countList =
firstWordElement.getElementsByTagName(ct);
Element countElement = (Element)countList.item(0);

NodeList textCTList = countElement.getChildNodes();
int ct =
Integer.parseInt(((Node)textCTList.item(0)).getNodeValue().trim());
myCh.setCount(ct);
chars.add(myCh);

}//end of if clause

}//end of for loop with s var

}catch (SAXParseException err) {
System.out.println (** Parsing error + , line 
 + err.getLineNumber () + , uri  + err.getSystemId
());
System.out.println(  + err.getMessage ());

}catch (SAXException e) {
Exception x = e.getException ();
((x == null) ? e : x).printStackTrace ();

}catch (Throwable t) {
t.printStackTrace ();
}

}

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Re: XML DOM Parser works in JAVA, Crashes Android App

2011-09-30 Thread Dancing Fingers
Thanks Kumar,
It keeps opening the DexFile.class (seems to throw an io exception)
in the debugger and says Source not found.  It asks me if I want to
change the source.  Nothing really glaring in the log.  Why does the
compiler see my file and not the runtime guys?

Thanks.
Chris

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Re: XML DOM Parser works in JAVA, Crashes Android App

2011-09-30 Thread Dancing Fingers
Thanks Kostya,
My debugging talent isn't great.  I got a parsing error on line 5.

I really wish that System.out.println would print to console rather
than Log, but that's just me.

Thanks.
Chris

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Re: XML DOM Parser works in JAVA, Crashes Android App

2011-09-30 Thread Dancing Fingers
This is very weird, the debugger steps, using step into, the try and
than steps back out to the parent of the method without printing the
warning statements.  I guess io would be hard to write a debugger for.

If I were the Android Plugin God, I would have Log.i print to the
LogCat and System.out.Print print to console.  Just a thought.

Thanks for the support though.

Chris

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Re: XML DOM Parser works in JAVA, Crashes Android App, Now XMLPullParser

2011-09-30 Thread Dancing Fingers
So I'm starting to suspect my XML file.  Here it is:

?xml version=1.0 encoding=UTF-8?
Chars
  ChPair
  chE/ch
  ct175391/ct
  /ChPair

  ChPair
  chT/ch
  ct129899/ct
  /ChPair

  ChPair
  chA/ch
  ct110693/ct
  /ChPair

  ChPair
  chO/ch
  ct108786/ct
  /ChPair
/Chars


I rewrote the method to use a XML pull parser:


public void parseCharXmlFile(){
Chars myCh = null;
String nameTag= ;

try {
InputStream iStrm = 
getResources().openRawResource(R.xml.chars);
XmlPullParser parser = Xml.newPullParser();
parser.setInput(iStrm, null);
int eventType = parser.getEventType();
boolean done = false;

while (eventType != XmlPullParser.END_DOCUMENT ){
switch (eventType){
case XmlPullParser.START_DOCUMENT:
chars.clear();
break;
case XmlPullParser.START_TAG:
nameTag = parser.getName();
if (nameTag.equalsIgnoreCase(ch) ) {
myCh.setTheChar(parser.nextText().charAt(0));
}else if 
(nameTag.equalsIgnoreCase(count)) {

myCh.setCount(Integer.parseInt(parser.nextText()));
chars.add(myCh);
}
break;
}  // event switch end
eventType = parser.next();
   }
} catch (Exception e) {
throw new RuntimeException(e);
}

   }


Every thing that I've read indicate that this should work.  Any
thoughts would be appreciated.

Chris

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Re: XML DOM Parser works in JAVA, Crashes Android App, Now XMLPullParser

2011-09-30 Thread Dancing Fingers
Thanks Kostya,
I changed the '0' to a '1' without success.  Actually Chars have only
2 fields: a char and an int, which I thought setters were for.  The
thing of it is that I keep getting an XMLPullParserException, saying
that I'm reading line -1, column -1.

Thanks.

Chris

On Sep 30, 6:18 pm, Kostya Vasilyev kmans...@gmail.com wrote:
 I don't see your code ever assigning anything to myCh, so expect it to crash
 when trying to call setTheChar and setCount.

 Also, that charAt(0) should really be charAt(1), no?

 --
 Kostya Vasilyev
 01.10.2011 2:03 пользователь Dancing Fingers batym...@gmail.com написал:







  So I'm starting to suspect my XML file. Here it is:

  ?xml version=1.0 encoding=UTF-8?
  Chars
  ChPair
  chE/ch
  ct175391/ct
  /ChPair

  ChPair
  chT/ch
  ct129899/ct
  /ChPair

  ChPair
  chA/ch
  ct110693/ct
  /ChPair

  ChPair
  chO/ch
  ct108786/ct
  /ChPair
  /Chars

  I rewrote the method to use a XML pull parser:

  public void parseCharXmlFile(){
  Chars myCh = null;
  String nameTag= ;

  try {
  InputStream iStrm = getResources().openRawResource(R.xml.chars);
  XmlPullParser parser = Xml.newPullParser();
  parser.setInput(iStrm, null);
  int eventType = parser.getEventType();
  boolean done = false;

  while (eventType != XmlPullParser.END_DOCUMENT ){
  switch (eventType){
  case XmlPullParser.START_DOCUMENT:
  chars.clear();
  break;
  case XmlPullParser.START_TAG:
  nameTag = parser.getName();
  if (nameTag.equalsIgnoreCase(ch) ) {
  myCh.setTheChar(parser.nextText().charAt(0));
  }else if (nameTag.equalsIgnoreCase(count)) {
  myCh.setCount(Integer.parseInt(parser.nextText()));
  chars.add(myCh);
  }
  break;
  } // event switch end
  eventType = parser.next();
  }
  } catch (Exception e) {
  throw new RuntimeException(e);
  }

  }

  Every thing that I've read indicate that this should work. Any
  thoughts would be appreciated.

  Chris

  --
  You received this message because you are subscribed to the Google
  Groups Android Developers group.
  To post to this group, send email to android-developers@googlegroups.com
  To unsubscribe from this group, send email to
  android-developers+unsubscr...@googlegroups.com
  For more options, visit this group at
 http://groups.google.com/group/android-developers?hl=en

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Re: Unexpected Canvas Behavior when using Threads and supporting Methods

2011-09-23 Thread Dancing Fingers
My dumb - and embarrassed.  Put the clear in the wrong spot.

Chris

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Unexpected Canvas Behavior when using Threads and supporting Methods

2011-09-22 Thread Dancing Fingers
Hi guys,
I'm trying to animate a path, on a canvas, using a thread routine.
I'm drawing/animating a pentagon over and over so I decided to put it
into a method, passing canvas to the method.  Every time I draw a
pentagon, using this method, it makes everything else vanish.  The
method works perfectly without threading and other stuff appears as
expected when this method isn't used.  I tried returning the canvas
without success.

Has any one else run into this?  Do I need to forget having a
supporting method and just do everything in onDraw?

Thanks.

Chris

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Combining Canvas with OpenGL

2011-09-05 Thread Dancing Fingers
Does any one know if you can map a View canvas onto an OpenGL surface
in Android?

Just curious.

Chris

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Re: parsing an XML document

2011-08-18 Thread Dancing Fingers
So when do you use the Android parser, that parses stuff like
manifest.xml, as opposed to JAVA parsers.

Just curious.

Chris

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Re: Emulator has Alzheimers (forgets who it is)

2011-08-02 Thread Dancing Fingers
I've had issues were the code in Eclipse is correct but the  emulator
doesn't respond to the new code.  I restart the emulator (a pain) and
the app runs as expected.I'd be interested if others have experienced
this and on what OS.
Chris

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Differences between Android Button and JAVA buttons

2010-10-11 Thread Dancing Fingers
Hi guys,
I'm working on my own Hexagonal button which works in JAVA.  I was
studying Android Button.java:

@RemoteView
public class Button extends TextView {
public Button(Context context) {
this(context, null);
}

public Button(Context context, AttributeSet attrs) {
this(context, attrs, com.android.internal.R.attr.buttonStyle);
}

public Button(Context context, AttributeSet attrs, int defStyle) {
super(context, attrs, defStyle);
}
}

I don't understand where it gets it shape.  If you're adding an
anClickListener of does button know the geometry that's within it's
boundries?

Any enlightenment would be appreciated.

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] ArrayList in Custom View??

2010-10-10 Thread Dancing Fingers
Hi guys,
I'm writing my own custom view, a keyboard, which I think the
ArrayList in the keyboard view is causing the application to quit in
the emulator.

public static ArrayListHexButton hexButtons = new
ArrayListHexButton();

The application ran fine when I did

setContentView(myKeyboardView);

But I want to nest my keyboard with a TextView so I'd like to be able
to do

setContentView(R.layout.main);

Any thoughts would be appreciated.

Chris

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en