[android-beginners] Re: Is it possible to append a value to R.string or any resource under R.?

2009-10-25 Thread Jeffrey Blattman




On 10/24/09 5:10 PM, David wrote:

  
@Farproc

Ah yes, the R.xx.xx are integer constants created automatically in the
R.java file (i.e., h1=0x7f050002, h2=0x7f050003, etc.).  Now it makes
sense why constructing a string to reference them does not work.


@Jeffrey

I have a couple of questions.  I just finished reading up a bit on
resource bundles but things are still a little cloudy for me.  Would I
need to populate the 312 key:value pairs into the rb bundle?

  

yes. 

  If so, then what benefits does the bundle approach have over the the
ElseIf approach?  It seems that putting 312 strings (even if small)
into a resource bundle would be more memory usage than required when,
in the alternative, the one desired string could be called directly
from an ElseIf approach, albeit with more lines of code.

  

one line of code vs. 312 ... and being forced to use a 2nd way to store
your resource strings. 


  Similar to your bundle idea, I thought about creating an XML array
with each string as a member but, again, all of the strings would be
pulled into memory to create the array when all I need is *one* of the
312 strings.  Too bad there isn't a way to dynamically construct a
reference to the R. resources . . .

  

XML is going to be heavier weight than a simple key, val mapping. btw,
if they are localized strings, use resource bundle. if not, just use
java.util.Properties.

  Thanks for answering questions from a new Java-Android developer
coming from the PHP side of things.




On Oct 24, 7:17am, Jeffrey Blattman jeffrey.blatt...@gmail.com
wrote:
  
  
using standard java res bundles,

textView.setText(rb.getString(desiredString));

and in your res bundle,

desiredString1=value of R.string.h1
desiredString2=value of R.string.h2
...

that is, the RB keys are the possible values of desiredString, and the
values are the proper mapping from a particular value of desired string.

On 10/23/09 6:59 PM, David wrote:





  Screen A permits the user to input a value into an EditText field.
Screen B populates a TextView using one of the entries in strings.xml
based upon the TextView value. For example, if the user inputs "2" on
Screen A then Screen B should populate the TextView with
R.strings.h2. I have tried the following:
  




 // get the bundle extras from Screen A's intent
   Bundle extras = getIntent().getExtras();
   // pull out the value from the UserInput EditText sent from
Screen A
   Str desiredString = extras != null ? extras.getString
("UserInput") : "";
   // popluate textView with the string R.string.h + whatever the
user put on Screen A
   textView.setText(R.string.h + desiredString);
  




  I get a "cannot resolve R.string.h resource" error message because,
evidently, the desiredString value is not appended onto R.string.h.
So, I decided to come at it from another angle:
  




 switch (desiredString) {
   case 1:
 textView.setText(R.string.h1);
   case 2:
 textView.setText(R.string.h2);
   . . .
   case 312:
 textView.setText(R.string.h312);
  




  Note that you cannot switch on a string so I tried Integer.parseInt on
the string but I wind up with a blank Screen B with the switch
statement above. It seems that the string is not turned into an int.
So, my question is twofold: (1) is it possible to append a variable
onto a R. entry and (2) if I am obliged to use the larger and uglier
switch approach, how do I turn an EditText string value into an Int
value? 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
android-beginners+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en
-~--~~~~--~~--~--~---

  


-- 





[android-beginners] 1.6 (donut) in Canada? is rooting the only option?

2009-10-25 Thread droidnoob

hey there

quick question im a bit of a beginner when it comes to android.
im wondering if anyone knows if there's going to be an OTA update
for rogers Dream users or should i just root my phone to enjoy all
of the benefits of a US G1 owner. if anyone knows how to root a
rogers
htc dream would be greatly 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
android-beginners+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en
-~--~~~~--~~--~--~---



[android-beginners] Accidentaly flashed my G1 to an ADP phone

2009-10-25 Thread Roland Guba

Hello guys!

I'm new with the android OS, so I would like to ask your help with my
problem. My intention was originally to flash Cyanogen mod to my newly
bought phone. I succesfully rooted my 1.1 firmware G1, and after that,
I managed to replace the original recovery console with CyanogenMod
Recovery 1.4 through flashrec.
In the recovery console I flashed to the signed-
dream_devphone_userdebug-img-14721.zip which i've downloaded from the
HTC developer page. Everything went fine, but after the flashing
completed I accidentaly hit the reboot option before I could start the
Cyanogen flash.

So eventually I made an 1.6 firmware Android Dev Phone 1 which I didnt
wanted to.

Can I change it back to a regular phone with a previous firmware or I
stuck with this forever?

I couldnt install flashrec anymore, and the Cyanogens recovery console
has been replaced with the original one. When I try to install HardSPL
the installiaton aborts itself about halfway. I tried to downgrade
through bootloader with an RC7 dreaimg, but it sad not allowed.
Maybe good news is that I made a backup with Nandroid before the
flashing, but as I read in order to restore it I need HardSPL.

Details:

T-Mobile G1 (Drea110 PVT 32B; HBOOT-0.95.; CPLD-4)
Model number: Android Dev Phone 1
Firmware version: 1.6
Baseband version: 62.50S.20.17H_2.22.19.26I
Kernel version: 2.6.29-00479-g3c7df37android-bu...@apa26 #19
Build number: dream_devphone-userdebug 1.6 DRC83 14721 test-keys

I admit that I was lame and I pretty much fu.ked up, but any help
would be greatly appreciated.

Thank you in advance,
Roland

--~--~-~--~~~---~--~~
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] Android Emulator

2009-10-25 Thread Nat M

Hi,

My android emulator on eclipse takes = (Equal to) sign in its
default google toolbar and doesnt allows any of my activities/projects
to load.

Does anyone know about this issue?? If so please tell me what am I
doing wrong?


Thanks in Advance.


--~--~-~--~~~---~--~~
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] Problem with installing the Composite ADB interface

2009-10-25 Thread Jay

I am trying to install contacts2sim_pro.apk to my phone. Does anyone
can tell me or show me on how to do the installation or any proper
file that I can used to get the HTC dream working. I have tried the
latest version android-sdk-windows-1.6_r1. But windows comes out an
error message device cannot start (error 10) after it is installed.
Please help me.

--~--~-~--~~~---~--~~
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] Is there a visual guide to Android components?

2009-10-25 Thread Brian

Hello

As someone who is fairly new to Java I use online documentation and
other resources very often to either to jog my memory or to learn
something new. As a visual learner and frequent user of Sun's Java
tutorials I find a lot of comfort in images and diagrams.

Sun has a great section titled A Visual Guide to Swing Components
(Java Look and Feel) which can be found here:
http://java.sun.com/docs/books/tutorial/ui/features/components.html
which names each Swing component and then has an example image of them
in action. I found a section similar to this for the Android
components in the Dev Guide but I can't seem to find it again. Does
anyone know where this is or another resource which provides something
similar?

--~--~-~--~~~---~--~~
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] Problem with installing the Composite ADB interface

2009-10-25 Thread Jay

I am trying to install contacts2sim_pro.apk to my phone. Does anyone
can tell me or show me on how to do the installation or any proper
file that I can used to get the HTC dream working. I have tried the
latest version android-sdk-windows-1.6_r1. But windows comes out an
error message device cannot start (error 10) after it is installed.
Please help me.

--~--~-~--~~~---~--~~
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] How do I get a view's height to fill the space in between two other views?

2009-10-25 Thread launchpadtt

Hello,

I'm learning android and I have extremely limited programming
experience or skills. Basically I want to have an activity whose
layout kinda looks like the gmail inbox's layout. I want a textview on
top, and a radio group of radio buttons in the middle and a row of
buttons at the bottom, but I want the radio group to fill the space in
between the text view on top and the row of buttons on the bottom.

I tried a LinearLayout with a TextView followed by a ScrollView with a
RadioGroup with RadioButtons in it followed by a LinearLayout with the
buttons in it. The moment I added too many radio buttons the linear
layout with the buttons went past the edge of the screen.

Then I tried the RelativeLayout with the ScrollView below the TextView
and the LinearLayout with the buttons in it having the
android:layout_alignParentBottom set to true. That puts the row of
buttons at the bottom but the scrollview's height reaches the bottom
of the screen and the radio buttons in it show up behind the row of
buttons.

I assume that I have to accomplish what I want programatically but I
don't really know how to do that. I'm thinking that I have to at some
point get the height of the textview and the linearlayout of buttons
and set the height of the scrollview to height of the screen - (height
of the textview + height of the linearlayout.) And that I'd probably
do that in onDraw or onSizeChanged of the view and I'd have to make a
new class extending textview or relativelayout that would have the new
onSizeChanged that would resize the scrollview.

Did I mention my limited skills? *sigh* Any assistance would be
appreciated.

--~--~-~--~~~---~--~~
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] Change Android Language

2009-10-25 Thread Memes

I am living in China and I bought a HTC Hero with Chinese version of
Android. Can anyone help me to change back the language to english, I
can not read the caracters, but if you give it to me, I can identify
them and change the settings.

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
android-beginners+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en
-~--~~~~--~~--~--~---



[android-beginners] Re: Is it possible to append a value to R.string or any resource under R.?

2009-10-25 Thread m_vitaly

I would suggest to use reflection in that case.
Just look for a field from R.string class named h + desiredString
and pass it's value to textView.setText()

Note that reflection is slower than direct access.

On Oct 24, 7:48 am, David dmackle...@gmail.com wrote:
 @Farpoc

 Your solution worked perfectly.  Thank you very much.  I have about
 300 possible strings the user can choose.  Is there a less CPU
 intensive way to do this without 300 else if statements?

 If not, hey, the application works well enough.  But it would be
 cleaner code if it were possible to use R.string.h + whatever the user
 entered on prior screen.  Is this possible?

--~--~-~--~~~---~--~~
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] including jar user libraries

2009-10-25 Thread gmseed

Hi

I created an Android project that works fine.

I then created a jar library in Eclipse using the User Library
dialog box and added it to my Android project.

When I now rebuild and rerun my application it crashes in both
emulator and device modes.

If I step through the debugger it's not much use as the application is
crashing immediately at startup.

Has anyone else experienced this problem?

Does the jar user library need to be explicitly specified in the
manifest file?

Cheers

Graham
--~--~-~--~~~---~--~~
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: connecting to a remote database tutorial/example?

2009-10-25 Thread jbrohan

Hello
I need to look up a database in my app. I'll be doing it next week I
expect. For the moment the php just returns a constant.
?php
$do = $_REQUEST['do'];
if ($do == groupphone){
$phone=trim($_REQUEST['phone']);
$phone=str_replace(array('.','(',')','-',' ','+'),'',$phone);
if (substr($phone,0,1) == '1') $phone = substr($phone,1); // remove
'1'
echo error; // initial testing
}elseif($do == startgroup){
echo xyz;
...

the java that does the call to the php program on the server is...

public String callWebPage(String URLstring, String parameters){
String s;
try {
URL updateURL = new URL(URLstring+parameters);
URLConnection conn = updateURL.openConnection();
InputStream is = conn.getInputStream();
BufferedInputStream bis = new BufferedInputStream(is);
ByteArrayBuffer baf = new ByteArrayBuffer(50);
Log.e(SettingsDialog, after the call to web);
int current = 0;
while((current = bis.read()) != -1){
baf.append((byte)current);
}
Log.e(SettingsDialog, back from web page+parameters);
/* Convert the Bytes read to a String. */
 s = new String(baf.toByteArray());
 Log.e(SettingsDialog, String.format(in callWebPage =
%s ,s));
 return s;
} catch (Exception e) {
Log.e(SettingsDialog, exception in callWebPage);
}
return error;
}

And the setup of the URLstring is...s = callWebPage(Constants.WebCall,
?do=groupphonephone=+s);  what the php script echoed is in s.

It seems to be very reliable.
It's worthwhile running your script from a browser first to make sure
that it works.

Good Luck
John


On Oct 24, 11:21 am, gmseed gms...@gmail.com wrote:
 Hi

 I'm developing an application to connect to a database on my website.

 Does anyone know of a link to an example/tutorial in which this kind
 of operation is performed?

 Thanks

 Graham
--~--~-~--~~~---~--~~
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: Poor Documentation

2009-10-25 Thread Sean Hodges

 I know the Android is a free system but I stand by my point that the
 documentation could be a lot better. The better the developer
 documentation, the better the take up.

No. The higher the demand for the Android platform (more phones, more
consumers) the better the take up. This holds true even if there was no
reference documentation at all.

Having said that, everyone wants up to date and comprehensive documentation,
we just need contributions to make this a reality. Have you done what I
suggested and reported the 2 omissions that you found on the bug tracker?
http://b.android.com. One example of a documentation change request can be
found here:

http://code.google.com/p/android/issues/detail?id=461amp;can=1amp;q=documentationamp;colspec=ID%20Type%20Status%20Owner%20Summary%20Stars


Cheers,

Sean


On Sat, Oct 24, 2009 at 6:19 PM, gmseed gms...@gmail.com wrote:

 Hi

 Thanks for your reply.

 I took the Sensor developer page as a typical example:

 http://developer.android.com/reference/android/hardware/Sensor.html

 and in the summary section the methods have no comments.

 If I take another random section as an example; DialerFilter:

 http://developer.android.com/reference/android/widget/DialerFilter.html

 and select getDigits() you'll now see that there are no comments in
 either the summary or main section.

 I know the Android is a free system but I stand by my point that the
 documentation could be a lot better. The better the developer
 documentation, the better the take up.

 Cheers

 Graham

 On 22 Oct, 10:00, gmseed gms...@gmail.com wrote:
 Is it me or is the Android Developer Reference documentation an
 absolute sham?

 Take the Sensor page, which lists the public methods:

 float   getMaximumRange()
 String  getName()
 float   getPower()
 float   getResolution()
 int     getType()
 String  getVendor()
 int     getVersion()

 Not a single comment as to what these do. Readers must be expected to
 be mind readers.

 Then take SensorListener, which provides a few comments on the
 accelermoeter, magnetic and orientation sensors but no mention of the
 other sensors.

 When I run an application with onSensorChanged  (int sensor, float[]
 values) it outputs 6 values and not 3 as the documentation would
 suggest.

 Etc, etc,

 Developers are expected to fish around and use guess work to try and
 figure out what's actually going on.

 Working with 4x4 rotation axis matrices is tricky stuff and needs
 detailed explanations.

 With all of Google's backing you'd think the documentation would be
 excellent.

 Consider the alternative system of Qt by Trolltech. The Assitant
 documentation is excellent and has led to a big take up of Qt. If
 Google wants developers to get up to speed fast on Android then they
 should phone the Trollech documenting team asap.

 I gather from reading previous posts that this documentation issue is
 not new and has been around since the start of Android. Clearly then
 somebody at Google has a strange idea as to what documenting an API
 means.

 The Android system is amazing but really let down by its developer
 documentation.
 


--~--~-~--~~~---~--~~
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] How to import an existing project into Eclipse?

2009-10-25 Thread Freeman Zhang
HI

I wanna import some codes sample to the Eclipse to learn the API usage.
But, when I choose import from the menu, I found there's no Android
project in it.

How can I import an existing project into the Eclipse?

Thanks a lot.

Regards,
Freeman

--~--~-~--~~~---~--~~
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] Selling applications from outside the approved countries

2009-10-25 Thread jax

I don't live in the approved countries supported by the Android
Market...so what are my options?

1.  Am I totally locked out of the android market?
2.  Can anyone from any country sell on slideme.com?
3.  Are there any other app stores?
4.  If I sell from my website how will I control piracy?
--~--~-~--~~~---~--~~
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: How to import an existing project into Eclipse?

2009-10-25 Thread jax

File -- Import -- Existing Projects into Workspace

Click browse and find the API demo directory



On Oct 25, 7:53 pm, Freeman Zhang pcman.zh...@gmail.com wrote:
 HI

 I wanna import some codes sample to the Eclipse to learn the API usage.
 But, when I choose import from the menu, I found there's no Android
 project in it.

 How can I import an existing project into the Eclipse?

 Thanks a lot.

 Regards,
 Freeman
--~--~-~--~~~---~--~~
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: How to import an existing project into Eclipse?

2009-10-25 Thread Freeman Zhang
Sorry, it doesn't work.
But, I find the way,  File - New - Android Project - Create Project form
existing source

Thanks a lot.


2009/10/25 jax jackma...@gmail.com


 File -- Import -- Existing Projects into Workspace

 Click browse and find the API demo directory



 On Oct 25, 7:53 pm, Freeman Zhang pcman.zh...@gmail.com wrote:
  HI
 
  I wanna import some codes sample to the Eclipse to learn the API usage.
  But, when I choose import from the menu, I found there's no Android
  project in it.
 
  How can I import an existing project into the Eclipse?
 
  Thanks a lot.
 
  Regards,
  Freeman
 


--~--~-~--~~~---~--~~
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] error message

2009-10-25 Thread android

if the field is empty I send the error message where wrong
public class localizza extends Activity {


private EditText latitudine;
private EditText longitudine;
private Button btnlocalizza;
private static ProgressDialog pd;
private Thread trovaerrore;
public void onCreate(Bundle savedInstanceState) {


super.onCreate(savedInstanceState);
super.onCreate(savedInstanceState);
super.onCreate(savedInstanceState);
setContentView(R.layout.localizza);
latitudine = (EditText) findViewById
(R.id.widget30_latitudine);
longitudine = (EditText) findViewById
(R.id.widget31_longitudine);
btnlocalizza = (Button) findViewById
(R.id.mymap2_btn_localizza);

btnlocalizza.setOnClickListener(new OnClickListener() {
public void onClick(View v) {

pd = ProgressDialog.show(localizza.this, 
Localizzo, la tua
posizione, true, false);

trovaerrore = new Thread() {
public void run(){

try {
Intent myMap = new 
Intent(Intent.ACTION_VIEW);
Uri uri = 
Uri.parse(geo:0,0?q=http://www.boole.it/kml/
generale.kml);
myMap.setData(uri);

startActivity(Intent.createChooser(myMap, mymap2));
Thread.sleep(1500);
} catch (Exception e) {

}

mostraindirizzo.sendEmptyMessage(0);
}
};
trovaerrore.start();

}
});
}

private Handler mostraindirizzo = new Handler() {
@Override
public void handleMessage(Message msg) {
pd.dismiss();

if (latitudine.getTextSize() == -1) {
Dialog locationError = new AlertDialog.Builder(

localizza.this).setIcon(0).setTitle(

Errore).setPositiveButton(R.string.ok, null)
.setMessage(
Input non 
trovato.)
.create();
locationError.show();

}

}

};
}


--~--~-~--~~~---~--~~
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: Is there a visual guide to Android components?

2009-10-25 Thread tinyang

Try this:
http://developer.android.com/guide/topics/ui/index.html 

-Original Message-
From: android-beginners@googlegroups.com
[mailto:android-beginn...@googlegroups.com] On Behalf Of Brian
Sent: Saturday, October 24, 2009 6:43 PM
To: Android Beginners
Subject: [android-beginners] Is there a visual guide to Android components?


Hello

As someone who is fairly new to Java I use online documentation and other
resources very often to either to jog my memory or to learn something new.
As a visual learner and frequent user of Sun's Java tutorials I find a lot
of comfort in images and diagrams.

Sun has a great section titled A Visual Guide to Swing Components (Java
Look and Feel) which can be found here:
http://java.sun.com/docs/books/tutorial/ui/features/components.html
which names each Swing component and then has an example image of them in
action. I found a section similar to this for the Android components in the
Dev Guide but I can't seem to find it again. Does anyone know where this is
or another resource which provides something similar?


No virus found in this incoming message.
Checked by AVG - http://www.avg.com
Version: 8.0.169 / Virus Database: 270.13.71/2332 - Release Date: 10/24/2009
2:31 PM


--~--~-~--~~~---~--~~
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: Unable to check correct row when using CheckedTextView

2009-10-25 Thread Jason Van Anden
Does anyone know if this thread ended well?  I attempting to create a fancy
list with a multiple selection (in 1.6).

The following code give seemingly random results using a SimpleCursorAdapter
...

@Override
protected void onListItemClick(ListView l, View v, int position, long
id) {

super.onListItemClick(l, v, position, id);

CheckedTextView cb = (CheckedTextView)
v.findViewById(R.id.bulkload_ok);

Log.d(Peeps.TAG, view clicked was ..  + cb.isChecked());

if (cb.isChecked()){
cb.setChecked(false);
Log.d(Peeps.TAG, set to .. false ==  + cb.isChecked());
} else {
cb.setChecked(true);
Log.d(Peeps.TAG, set to .. true ==  + cb.isChecked());
}

v.refreshDrawableState();

//select_track();
}


LAYOUT HERE:


?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=wrap_content
android:orientation=vertical
android:padding=6sp

ImageView
android:id=@+id/album_art
android:layout_width=wrap_content
android:layout_height=wrap_content
android:paddingTop=6sp
android:paddingBottom=6sp
android:paddingLeft=10sp
android:maxWidth = 70sp
android:maxHeight= 70sp
android:adjustViewBounds=true
android:src=@drawable/icon
/

TextView
android:id=@+id/song_name
android:textSize=16sp
android:textStyle=bold
android:layout_width=wrap_content
android:layout_height=wrap_content
android:paddingRight=70sp
android:paddingLeft=78sp
android:text=Song Title /


TextView android:id=@+id/song_album_title
android:textSize=14sp
android:layout_width=fill_parent
android:layout_height=wrap_content
android:paddingLeft=78sp
android:layout_below=@id/song_name
android:layout_alignParentLeft=true
android:text=Album Title /

TextView android:id=@+id/song_artist_name
android:textSize=14sp
android:layout_width=wrap_content
android:layout_height=wrap_content
android:paddingLeft=78sp
android:layout_below=@id/song_album_title
android:layout_alignParentLeft=true
android:text=Artist Name /

CheckedTextView
android:id=@+id/bulkload_ok
android:layout_alignTop=@+id/song_name
android:layout_height=wrap_content
android:layout_width=wrap_content
android:layout_alignParentRight=true
android:checkMark=?android:attr/listChoiceIndicatorMultiple
android:checked = false
android:text=
  /CheckedTextView

TextView android:id=@+id/song_duration
android:textSize=12sp
android:layout_width=wrap_content
android:layout_height=wrap_content
android:layout_below=@id/song_album_title
android:textColor=#FDFCDC
android:layout_alignParentRight=true
android:text=0:00 /


/RelativeLayout

--~--~-~--~~~---~--~~
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] Call URL

2009-10-25 Thread David Kebo

I am trying to call a URL for code.
This URL is supposed to move a camera connected on the same network

url = new URL(http://10.0.1.90/axis-cgi/com/ptz.cgi?
camera=1move=home);
URLConnection cameraConnection = url.openConnection();
cameraConnection.connect();

I get no response when I run this code. Is this the right way to call
a URL from an Android phone ?

--~--~-~--~~~---~--~~
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: Unable to check correct row when using CheckedTextView

2009-10-25 Thread Jason Van Anden
OK.  I am an idiot.

This was not working for me because I had left-over code in onCreate from
something else I tried:

//listView.setItemsCanFocus(false);
//listView.setChoiceMode(ListView.CHOICE_MODE_MULTIPLE);

In the process I learned an awful lot from Mark Murphy's examples in Fancy
Lists section of the Busy Coders Guide (
http://commonsware.com/Android/index.html) and Romain Guy's YouTube
presentation here (http://www.youtube.com/watch?v=UApv-ZMJ51g).

Jason

--~--~-~--~~~---~--~~
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: Accidentaly flashed my G1 to an ADP phone

2009-10-25 Thread ohnoezitasploded

This is a development forum, for programmers.  If you post in the XDA
Developers Dream QA forum someone will help you.

On Oct 24, 10:49 am, Roland Guba rol...@gmail.com wrote:
 Hello guys!

 I'm new with the android OS, so I would like to ask your help with my
 problem. My intention was originally to flash Cyanogen mod to my newly
 bought phone. I succesfully rooted my 1.1 firmware G1, and after that,
 I managed to replace the original recovery console with CyanogenMod
 Recovery 1.4 through flashrec.
 In the recovery console I flashed to the signed-
 dream_devphone_userdebug-img-14721.zip which i've downloaded from the
 HTC developer page. Everything went fine, but after the flashing
 completed I accidentaly hit the reboot option before I could start the
 Cyanogen flash.

 So eventually I made an 1.6 firmware Android Dev Phone 1 which I didnt
 wanted to.

 Can I change it back to a regular phone with a previous firmware or I
 stuck with this forever?

 I couldnt install flashrec anymore, and the Cyanogens recovery console
 has been replaced with the original one. When I try to install HardSPL
 the installiaton aborts itself about halfway. I tried to downgrade
 through bootloader with an RC7 dreaimg, but it sad not allowed.
 Maybe good news is that I made a backup with Nandroid before the
 flashing, but as I read in order to restore it I need HardSPL.

 Details:

 T-Mobile G1 (Drea110 PVT 32B; HBOOT-0.95.; CPLD-4)
 Model number: Android Dev Phone 1
 Firmware version: 1.6
 Baseband version: 62.50S.20.17H_2.22.19.26I
 Kernel version: 2.6.29-00479-g3c7df37android-bu...@apa26 #19
 Build number: dream_devphone-userdebug 1.6 DRC83 14721 test-keys

 I admit that I was lame and I pretty much fu.ked up, but any help
 would be greatly appreciated.

 Thank you in advance,
 Roland
--~--~-~--~~~---~--~~
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: Does anyone know how to set G1 use Wi-Fi with static IP?

2009-10-25 Thread Farproc

Thank you!!

On 10月24日, 下午1时21分, Michael Cheselka chese...@gmail.com wrote:
 Hello ,

 Usually the router can offer the same ip based on the mac address.

 I use dd-wrt and there is an option to add the hostname, mac address,
 and ip address you wish.

 Regards,
 Michael Cheselka
 650-488-4820



 On Fri, Oct 23, 2009 at 20:02, Farproc farp...@gmail.com wrote:

  I set my G1 use static IP and disable DHCP of my router. But it seems
  that my G1 still obtains a different IP address from router anyway.
  Does anyone know why??

  ps. I can visit internet through the auto obtained IP.
--~--~-~--~~~---~--~~
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: How do I get a view's height to fill the space in between two other views?

2009-10-25 Thread Justin Anderson
If you are using XML layouts, there are a couple things you could try...

1) Set the layout to use fill_parent instead of wrap_content
2) Give the layout a weight... android:layout_weight

Thanks,
Justin

--
There are only 10 types of people in the world...
Those who know binary and those who don't.
--


On Sat, Oct 24, 2009 at 7:52 PM, launchpadtt
christopher.yee...@gmail.comwrote:


 Hello,

 I'm learning android and I have extremely limited programming
 experience or skills. Basically I want to have an activity whose
 layout kinda looks like the gmail inbox's layout. I want a textview on
 top, and a radio group of radio buttons in the middle and a row of
 buttons at the bottom, but I want the radio group to fill the space in
 between the text view on top and the row of buttons on the bottom.

 I tried a LinearLayout with a TextView followed by a ScrollView with a
 RadioGroup with RadioButtons in it followed by a LinearLayout with the
 buttons in it. The moment I added too many radio buttons the linear
 layout with the buttons went past the edge of the screen.

 Then I tried the RelativeLayout with the ScrollView below the TextView
 and the LinearLayout with the buttons in it having the
 android:layout_alignParentBottom set to true. That puts the row of
 buttons at the bottom but the scrollview's height reaches the bottom
 of the screen and the radio buttons in it show up behind the row of
 buttons.

 I assume that I have to accomplish what I want programatically but I
 don't really know how to do that. I'm thinking that I have to at some
 point get the height of the textview and the linearlayout of buttons
 and set the height of the scrollview to height of the screen - (height
 of the textview + height of the linearlayout.) And that I'd probably
 do that in onDraw or onSizeChanged of the view and I'd have to make a
 new class extending textview or relativelayout that would have the new
 onSizeChanged that would resize the scrollview.

 Did I mention my limited skills? *sigh* Any assistance would be
 appreciated.

 


--~--~-~--~~~---~--~~
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] video frame

2009-10-25 Thread Vinu Vijayan

Hi all,

is there any api availble to get the first screen of an video file so
that we can show the first frame of the videos while listing the
videos.
--~--~-~--~~~---~--~~
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] WebView clearHistory() problem

2009-10-25 Thread erisa

I have several buttons on a screen, each of which makes a WebView on
the layout visible and loads a different Url.  Pushing the back return
while viewing the URl makes the WebView gone and returns the user to
the button screen.

My problem is that often, but not always, pressing the back button
returns to a previously viewed page and not the button screen.  I
assumed that clearHistory() would solve the problem, but it did not.
I tried calling clearHistory() before the loadUrl and after the
loadUrl, but the problem remains.  Any ideas?
--~--~-~--~~~---~--~~
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: Battery Usage Indicator API - JDK 1.6

2009-10-25 Thread SagarH

While continuing on my research:

I am currently stuck at trying  to find out which class actually
modifies the values of android.os.BatteryManager (BatteryManager.java)

Any ideas ?


-Sagar Hatekar

--~--~-~--~~~---~--~~
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] file chooser?

2009-10-25 Thread Jeffrey Blattman




this has to be an easy one. i want to bring up a file chooser to be
able to read a file from say the SD card. i'd rather not roll my own.
is there some standard way to do this?

--