| Author |
Message |
apple2183 Junior Developer

Joined: 10 Apr 2009 Posts: 24
|
Posted: Wed Apr 15, 2009 12:19 pm Post subject: |
|
|
Dear sir/madam,
I just try to provide useful information to all people about android, and it may or may not useful to you , that is way I did not post more information in the messages.
Thank you
|
|
| Back to top |
|
 |
|
|
 |
WarrenFaith Moderator

Joined: 13 Mar 2009 Posts: 227 Location: Berlin, Germany
|
Posted: Wed Apr 15, 2009 12:25 pm Post subject: |
|
|
| apple2183 wrote: | Dear sir/madam,
I just try to provide useful information to all people about android, and it may or may not useful to you , that is way I did not post more information in the messages.
Thank you |
you argument against yourself.... "i just try to provide useful information to all" and "that is why I did not post more information [...]"
You spam for you very small and very unuseful website. You posted one link 16 times! The other link 4 times. Thats pure spam and even bad spam if I read your post count.... 22, that makes 2 posts without a link... congratulation for this performance!
_________________ droidnova.com - Android application development blog |
|
| Back to top |
|
 |
apple2183 Junior Developer

Joined: 10 Apr 2009 Posts: 24
|
Posted: Wed Apr 15, 2009 1:00 pm Post subject: |
|
|
Hi sir/madam,
Sorry, since the information is not useful to you.
Thank you.
|
|
| Back to top |
|
 |
slashrun Once Poster

Joined: 12 Aug 2009 Posts: 1
|
Posted: Wed Aug 12, 2009 2:57 am Post subject: Cannot compile code |
|
|
I am using the downloaded .java files and just copy pasting them into like named .java files within an eclipse project. The project does not compile however; I have errors on line 90 in PizzaTimer.java stating that:
Description Resource Path Location Type
R.string.menu_reset cannot be resolved PizzaTimer.java AndDev Pizza/src/org/training/anddev/pizza line
and in PizzaView.java on line 77 stating that:
Description Resource Path Location Type
R.string.pizza_countdown_end cannot be resolved PizzaView.java AndDev Pizza/src/org/training/anddev/pizza line 77 Java Problem
Is there something that I need to add somewhere else? Thanks for your assistance.
Mac
|
|
| Back to top |
|
 |
hypermiler Freshman

Joined: 02 Nov 2009 Posts: 4
|
Posted: Wed Nov 11, 2009 6:28 pm Post subject: |
|
|
| Very helpful tutorial, thanks!
|
|
| Back to top |
|
 |
jayaram Junior Developer

Joined: 29 Jul 2009 Posts: 10 Location: India
|
Posted: Fri Dec 18, 2009 5:09 am Post subject: Notification not working |
|
|
Hello,
Thanks for this tutorial.
I tried this application. Everything is working right except the Notification.
As i'm using the newer SDK, i replaced this code
| Java: | nm.notifyWithText(PIZZA_NOTIFICATION_ID,
getText(R.string.pizza_notification_text),
NotificationManager.LENGTH_LONG, null); |
with this
| Java: |
Notification notification = new Notification(0,getText(R.string.pizza_notification_text),System.currentTimeMillis());
nm.notify(PIZZA_NOTIFICATION_ID,notification); |
But i'm not getting it.
Can someone help please...
|
|
| Back to top |
|
 |
|
|
 |
dgmdan Once Poster

Joined: 23 Dec 2009 Posts: 1
|
Posted: Sat Jan 02, 2010 4:10 am Post subject: Re: Notification not working |
|
|
Thanks for the tutorial, it's helping me wrap my brain around handlers. I made a few changes and have attached my source code. My changes are:
- Fixed a few small problems to make it build on android 1.5
- Changed the notification to a toast (as suggested by someone earlier)
- Added a onSaveInstanceState method, and added code to the OnCreate method, so the timer can survive a screen rotation (when the activity gets re-created)
- Changed all instances of this.whateverVariable to just whateverVariable
I'm a beginner myself so if there's any bugs, or I'm doing things the wrong way, please let me know!
Edited to fix some code.
| Description: |
|
 Download |
| Filename: |
PizzaTimer.zip |
| Filesize: |
3.39 KB |
| Downloaded: |
63 Time(s) |
|
|
| Back to top |
|
 |
sheshi85 Junior Developer

Joined: 08 Jun 2009 Posts: 15
|
Posted: Fri Jan 29, 2010 12:51 am Post subject: how to stop the timer!!!!!!! |
|
|
First of all very thanks for the code PlusMinus.Regarding the thread in the program .How does the thread get stopped from sleeping.I was implementing simple ticking program for something to be fired .I came across the prob.It says uncaught remote exception :Exceptions not yet supported across processes.when I hit the key .Also i am not able to stop the thread from sleeping .Please find the file attached here .Please give me a solution .Thanks in advance!!!!!!!!!!!!
| Description: |
|
 Download |
| Filename: |
Ticking.java |
| Filesize: |
2.05 KB |
| Downloaded: |
20 Time(s) |
|
|
| Back to top |
|
 |
spring Junior Developer

Joined: 09 Jan 2010 Posts: 14 Location: China
|
Posted: Fri Mar 05, 2010 8:58 am Post subject: |
|
|
great work,thanks
|
|
| Back to top |
|
 |
pskink Master Developer

Joined: 24 Nov 2008 Posts: 334
|
Posted: Fri Mar 05, 2010 10:25 am Post subject: Re: how to stop the timer!!!!!!! |
|
|
| sheshi85 wrote: | | First of all very thanks for the code PlusMinus.Regarding the thread in the program .How does the thread get stopped from sleeping.I was implementing simple ticking program for something to be fired .I came across the prob.It says uncaught remote exception :Exceptions not yet supported across processes.when I hit the key .Also i am not able to stop the thread from sleeping .Please find the file attached here .Please give me a solution .Thanks in advance!!!!!!!!!!!! |
please, please, please don't use Threads for such thing!!!
its like using cannons to shut the fly!
| Java: |
package com.arka.Ticking;
import android.app.Activity;
import android.os.Handler;
import android.os.Message;
import android.util.Log;
import android.view.KeyEvent;
public class Ticking extends Activity {
static final String TAG = "Ticking";
static final int MSG_CONTINUE = 0x1;
static final int MSG_RESET = 0x2;
static final int TOUT = 10;
private int secondspassed = 0;
@Override
protected void onResume() {
super.onResume();
// start count down
Log.i(TAG, "Start counting down");
mHandler.sendEmptyMessage(MSG_CONTINUE);
}
@Override
protected void onPause() {
super.onPause();
// stop count down
Log.i(TAG, "Stop counting down");
mHandler.removeCallbacksAndMessages(null);
}
Handler mHandler = new Handler() {
@Override
public void handleMessage(Message msg) {
if (msg.what == MSG_CONTINUE) {
secondspassed++;
if(secondspassed == TOUT) {
Log.i(TAG, "TimeOut!!!");
secondspassed = 0;
}
} else
if (msg.what == MSG_RESET) {
mHandler.removeCallbacksAndMessages(null);
secondspassed = 0;
Log.i(TAG, "Reset!!!");
}
Log.i(TAG, "Ticking!!! " + secondspassed);
// send next tick
sendEmptyMessageDelayed(MSG_CONTINUE, 1000);
}
};
@Override
public boolean onKeyDown(int keyCode, KeyEvent event) {
if (keyCode == KeyEvent.KEYCODE_DPAD_CENTER) {
// reset me
mHandler.sendEmptyMessage(MSG_RESET);
return true;
}
if (keyCode == KeyEvent.KEYCODE_BACK) {
finish();
return true;
}
return false;
}
}
|
p.s. something screw up formatting so i'm attaching source as well
| Description: |
|
 Download |
| Filename: |
Ticking.java |
| Filesize: |
1.53 KB |
| Downloaded: |
5 Time(s) |
_________________ pskink |
|
| Back to top |
|
 |
pskink Master Developer

Joined: 24 Nov 2008 Posts: 334
|
Posted: Fri Mar 05, 2010 1:33 pm Post subject: |
|
|
btw i see so many people using Threads/Timers/TimerTasks just to make some animations, changing periodically TextViews etc which is askinkg for troubles...
don't do that: use Handlers & Messages instead (see my previous post)
_________________ pskink |
|
| Back to top |
|
 |
|