| Author |
Message |
kirtikishan85 Once Poster

Joined: 13 Aug 2008 Posts: 1
|
Posted: Fri Aug 22, 2008 8:25 am Post subject: |
|
|
Hi Guys,
I need to create an currency converter where the currency should change on current market trend.
i.e. if the dollar value changes, then in our application the changed value should be reflected based on the
current value.
Do i need to use web services for that or is there any other way to work with.????
Thanx,
Kirti... |
|
| Back to top |
|
 |
velocity Junior Developer

Joined: 19 Aug 2008 Posts: 10
|
Posted: Mon Aug 25, 2008 1:18 pm Post subject: |
|
|
| Quote: | | Do i need to use web services for that or is there any other way to work with.???? |
If you don't want to enter the current currency rate manually, I guess you'll have to get them from the Internet.
This might help you. |
|
| Back to top |
|
 |
upensabnis Junior Developer

Joined: 16 Jul 2008 Posts: 10
|
Posted: Wed Sep 03, 2008 9:16 am Post subject: |
|
|
hi,
actually we are developing an email client. so we need to connect to the gmail server and we are unable to do it. so can anybody please help us. we are not getting like which api's to use...?? |
|
| Back to top |
|
 |
EwanG Freshman

Joined: 20 Sep 2008 Posts: 5 Location: San Antonio, TX
|
Posted: Sat Sep 27, 2008 8:09 pm Post subject: Step by Step for a board game? |
|
|
Am trying to build a "board-like" game, and discovering there are so many things missing in my understanding. Granted that's probably because most of my coding is in Hibernate or SQL*Plus (not much GUI there)
Anyway, I have my graphic tiles, but am not sure how to setup the view so that it creates a board from them. Since you can click on the tiles to move them (sort of like in a game of Reversi), I presume I need to build an array of them so they can be individually addressed? Since I count how far you "move" the tile to compute a score, I presume I also need to be able to tell where each one is to do that.
Then there's the whole question of a leaderboard for high scores. I presume you have to have somewhere that the game contacts to check the board and see where your score fits, if it qualifies at all. Or is that a web service that is already supported?
Anywho, a tutorial on this would be great. Or if someone can point me to some source code that's already out there (preferably in Android friendly language) that would be fine too. Heck, would even be willing to team up with someone if they need a graphics guy with a gaming idea but not so much UI experience...
Thanks in advance! |
|
| Back to top |
|
 |
legerb Freshman

Joined: 25 Sep 2008 Posts: 4
|
Posted: Sun Sep 28, 2008 8:29 am Post subject: intercepting calls |
|
|
Any chance for a tutorial showing usage of ACTION_NEW_OUTGOING_CALL, intercepting calls?
thanks ahead  |
|
| Back to top |
|
 |
Nemat Junior Developer

Joined: 21 Aug 2008 Posts: 24
|
Posted: Mon Sep 29, 2008 11:51 am Post subject: |
|
|
Hi,
Will you please write a tutorial for Http post connection in New SDK i.e. SDK-1.0.I've checked the changes but didnt fine classes like EventHandler and request queue...My code is | Code: |
public void go(Map<String,String> variables){
MyEventHandler myEvH = new MyEventHandler(this);
android.net.http.RequestQueue rQueue = new RequestQueue(this);
Map<String, String> headers = new HashMap<String, String>();
headers.put("Content-Type", "application/x-www-form-urlencoded");
String variablesURL;
if(variables != null && variables.size() > 0){
try {
StringBuilder b = new StringBuilder();
Set<String> keys = variables.keySet();
// Iterate over each variable you want and append it to our variablesURL variable
for(Iterator<String> i = keys.iterator();Wink{
String key = i.next();
b.append(key);
b.append("=");
b.append(URLEncoder.encode(variables.get(key), "UTF-8"));
// Minor speed optimization so that i.hasNext() is only called once (instead of in the for loop).
if(i.hasNext()){
b.append("&");
} else {
break;
}
}
variablesURL = b.toString();
} catch (UnsupportedEncodingException e) {
Log.e("HTTP_Request", "Unsupported Encoding Exception");
return;
}
} else {
variablesURL = "";
}
byte[] POSTbytes = variablesURL.getBytes();
ByteArrayInputStream baos = new ByteArrayInputStream(POSTbytes);
rQueue.queueRequest("http://www.zinsure.net/zinsure/JSONServlet", "POST", headers, myEvH, baos, POSTbytes.length, false);
}
private class MyEventHandler implements EventHandler {
private static final int RANDOM_ID = 0x1337;
private String DEBUG_TAG = null;
ByteArrayBuffer baf = new ByteArrayBuffer(20);
private Activity myActivity;
MyEventHandler(Activity activity) {
this.myActivity = activity;
}
public void data(byte[] bytes, int len) {
baf.append(bytes, 0, len); }
public void endData() {
String text = new String(baf.toByteArray());
myShowNotificationAndLog("Data loaded: \n" + text);
} catch (JSONException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
public void status(int arg0, int arg1, int arg2, String s) {
myShowNotificationAndLog("status [" + s + "]"); }
public void error(int i, String s) {
this.myShowNotificationAndLog("error [" + s + "]"); }
public void handleSslErrorRequest(int arg0, String arg1, SslCertificate arg2) { }
public void headers(Iterator arg0) { }
public void headers(Headers arg0) { }
private void myShowNotificationAndLog(String msg) {
Log.d(DEBUG_TAG, msg);
}
public void certificate(SslCertificate arg0) {
// TODO Auto-generated method stub
}
public void handleSslErrorRequest(SslError arg0) {
// TODO Auto-generated method stub
}
} |
|
|
| Back to top |
|
 |
Artur79 Junior Developer

Joined: 26 Sep 2008 Posts: 23
|
Posted: Fri Oct 03, 2008 12:16 pm Post subject: |
|
|
| I am joining to above request |
|
| Back to top |
|
 |
icx Freshman

Joined: 25 Oct 2008 Posts: 2
|
Posted: Sat Oct 25, 2008 6:22 pm Post subject: |
|
|
| kirtikishan85 wrote: | Hi Guys,
I need to create an currency converter where the currency should change on current market trend.
i.e. if the dollar value changes, then in our application the changed value should be reflected based on the
current value.
Do i need to use web services for that or is there any other way to work with.????
Thanx,
Kirti... |
I would also like to see this working. Thank you. |
|
| Back to top |
|
 |
icx Freshman

Joined: 25 Oct 2008 Posts: 2
|
Posted: Sat Oct 25, 2008 6:42 pm Post subject: |
|
|
And a personal request.
I don't know how it's possible to put different elements in an application. [i starded Android coding today ]
Take, for example, a simple GMAIL sign in page.
So i need two TextFields ("Username", "Password"), a username field, a password field, and a Sign In button. Can you help me with a source code or something? |
|
| Back to top |
|
 |
csvy Once Poster

Joined: 11 Nov 2008 Posts: 1
|
Posted: Tue Nov 11, 2008 9:01 am Post subject: Remembering Passwords |
|
|
| How do I securely store username/passwords for web services my applications are connecting to. |
|
| Back to top |
|
 |
MrSnowflake Moderator


Joined: 16 Feb 2008 Posts: 646 Location: Flanders, Belgium
|
Posted: Tue Nov 11, 2008 12:10 pm Post subject: |
|
|
| You can put them in a file in you app's directory. As you are running on Linux, no other app (except the root user) has access to the file. If you really want to have it encrypted, then you should look for "java file encryption", but I don't think this is nescessairy. |
|
| Back to top |
|
 |
yinglcs Freshman

Joined: 14 Nov 2008 Posts: 4
|
Posted: Sat Nov 15, 2008 5:56 am Post subject: Tutorial for drawing on andriod |
|
|
Is there anywhere I can find a Canvas tutorial for android? (like a drawing pad)
Like drawing lines, rectangle, image on canvas?
Thank you for any pointer. |
|
| Back to top |
|
 |
MrSnowflake Moderator


Joined: 16 Feb 2008 Posts: 646 Location: Flanders, Belgium
|
Posted: Sat Nov 15, 2008 4:56 pm Post subject: Re: Tutorial for drawing on andriod |
|
|
| yinglcs wrote: | | Like drawing lines, rectangle, image on canvas? | This is very easy. Look in the docs for Canvas. There are functions like Canvas.drawBitmap(), which is pretty straight forward. If you need a tutorial, look in the samples dir of the SDK there are a couple of 2D (and 3D) examples. |
|
| Back to top |
|
 |
Flixi Freshman

Joined: 16 Nov 2008 Posts: 2 Location: Dublin, Ireland
|
Posted: Sun Nov 16, 2008 3:10 am Post subject: |
|
|
Hi, I have been following some of your tutorials all ready and really liked them, very well written code.
I have gotten this strange idea that the G1 are missing a "Fish Tank" application. But to make that happen I need some more knowledge that I can't seam to find any where else. I want to make every fish as a object, and make those object float around in the tank (edges of the screen). I can make the tank, and a fish. But to make it all seam real I need to implement some gravity. To let the fishes swim correctly even you turn around the phone.. and make air bubbles float upwards.
It's this part with the gravity function that I would like a tutorial, I would expect it could be useful in many applications. The tutorial could just let air bubble float from the bottom of the screen and upwards.
As a side question, how do I make collisions between objects. It's not the worst thing there could happen that two fishes swim behind each other but I would like some kind of collisions between them, so they could turn around and swim the other way.
Kind regards
-Søren Kristian |
|
| Back to top |
|
 |
MrSnowflake Moderator


Joined: 16 Feb 2008 Posts: 646 Location: Flanders, Belgium
|
Posted: Sun Nov 16, 2008 11:49 am Post subject: |
|
|
Gravity is REALLY easy (just like on earth ). As you update your tank periodically you shift the x value of the bubble a bit more to 0 (when the bubble gets born its x-value = 256, in the next frame its 248, the next 240, ... until it's < 0 then it's probably gone). Normally you would add (substract) a certain value from the x-value each frame. | Java: | void newFrame(float timeElapsed) {
bubble.x -= timeElapsed*Gravity;
} | Why use timeElapsed? It's not certain your frame rate is the same all the time, so to make your app always run at the same speed, you need to correct for slowdowns, which is what timeElapsed is for. It gives you the time elapsed since the last frame got rendered.
There are a lot of collision detection algorithms (using the sprites itself, using bounding boxes around the sprites, using the sprites itself and look at the transparent color (so they only collide when the drawings touch), ...) and a lot of them are on the net, so try to search Google for that. If you find a good one, you can post it on the forums. |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You can download files in this forum
|
© 2007, Android Development Community
All rights reserved.
Powered by phpBB.
|