| Author |
Message |
amidos2006 Freshman

Joined: 27 Apr 2008 Posts: 3
|
Posted: Wed Apr 30, 2008 5:23 pm Post subject: I wanna ask about the chart |
|
|
I dont understand it at all
I dont know what is the invalidate(); command is for
But thnx for the tutorial any way
|
|
| Back to top |
|
 |
|
|
 |
amidos2006 Freshman

Joined: 27 Apr 2008 Posts: 3
|
Posted: Wed Apr 30, 2008 8:33 pm Post subject: |
|
|
I wanna ask something else I wanna use customView of the pizza in xml file defintion when i do so it says that error Exception:Binary XML file line #23:Error Inflating class SeekTimer.
SeekTimer is the Custom view. and line 23 is:
<SeekTimer android:id="@+id/seek_bar"
android:layout_width="50px"
android:layout_height="50px"
android:layout_centerHorizontal="true"/>
If anybody can help to remove that error i would be gratefull
|
|
| Back to top |
|
 |
cadlg Experienced Developer

Joined: 20 Feb 2008 Posts: 84 Location: Guatemala
|
Posted: Wed Apr 30, 2008 9:18 pm Post subject: |
|
|
Hi amidos2006.
When you use your custom view in XML, you need to implement the constructor that inflate the view based on the xml params... does your SeekTimer classs implement this constructor ?
| Java: | public SeekTimer (Context context, AttributeSet attrs,Map inflateParams) {
super(context, attrs, inflateParams);
} |
cadlg
|
|
| Back to top |
|
 |
amidos2006 Freshman

Joined: 27 Apr 2008 Posts: 3
|
Posted: Wed Apr 30, 2008 10:33 pm Post subject: Thnx |
|
|
Thanks it works
Thanks for your help
|
|
| Back to top |
|
 |
jishin Once Poster

Joined: 17 Jun 2008 Posts: 1
|
Posted: Sun Jul 06, 2008 1:05 pm Post subject: Re: Thnx |
|
|
It works except for the NotificationManager. As in m5, you should change the following code
| Java: |
NotificationManager nm = (NotificationManager)
getSystemService(NOTIFICATION_SERVICE);
nm.notifyWithText(PIZZA_NOTIFICATION_ID,
getText(R.string.pizza_notification_text),
NotificationManager.LENGTH_LONG, null);
|
to
| Java: |
Toast.makeText(PizzaTimer.this, R.string.pizza_notification_text, Toast.LENGTH_SHORT).show();
|
in order to make it work.
Cheers,
|
|
| Back to top |
|
 |
Txorl Junior Developer

Joined: 17 Sep 2008 Posts: 16
|
Posted: Sat Sep 20, 2008 5:16 pm Post subject: sdk 0.9 |
|
|
I rebuild both classes. Now they work for sdk 0.9
| Description: |
|
 Download |
| Filename: |
pizza.zip |
| Filesize: |
3.25 KB |
| Downloaded: |
442 Time(s) |
|
|
| Back to top |
|
 |
|
|
 |
ninor Moderator


Joined: 14 Aug 2008 Posts: 180 Location: Barcelona, Spain
|
Posted: Sat Sep 20, 2008 11:01 pm Post subject: |
|
|
| Thanks Txorl
|
|
| Back to top |
|
 |
ravi Freshman

Joined: 04 Nov 2008 Posts: 8
|
Posted: Tue Nov 04, 2008 11:30 pm Post subject: |
|
|
Thanks for the tutorial 'PlusMinus'. Also, thanks for the other tutorials on this forum, please keep them coming!
I have a question regarding this code: You posted a screen shot of "Notification even when PizzaTimer was 'sent to background' (BUT not yet killed)". How did you send the app to the background?
Thanks,
Ravi
|
|
| Back to top |
|
 |
yinglcs Junior Developer

Joined: 14 Nov 2008 Posts: 10
|
Posted: Sun Nov 16, 2008 4:23 am Post subject: I have problems in getting the Pizza timer example to work |
|
|
Hi,
I copy the source attached in the thread and try to get it to work in Andriod sdk 1.0 on eclipse on ubunutu:
I get the following compile errors:
1. i get a bunch of R.xxxx.xxx cannot be resolved. Where can I get the R file generated?
2. how to change the drawArc() with the right parameters?
3. how to change the
@Override
public boolean onMenuItemSelected(int featureId, Item item) {
...
}
Description Resource Path Location Type
Item cannot be resolved to a type PizzaTimer.java PizzaTimer/src/com/test line 94 Java Problem
NotificationManager.LENGTH_LONG cannot be resolved PizzaTimer.java PizzaTimer/src/com/test line 59 Java Problem
R.drawable.pizza cannot be resolved PizzaView.java PizzaTimer/src/com/test line 33 Java Problem
R.string.menu_reset cannot be resolved PizzaTimer.java PizzaTimer/src/com/test line 89 Java Problem
R.string.pizza_countdown_end cannot be resolved PizzaView.java PizzaTimer/src/com/test line 73 Java Problem
R.string.pizza_notification_text cannot be resolved PizzaTimer.java PizzaTimer/src/com/test line 58 Java Problem
The method drawArc(RectF, float, float, boolean, Paint) in the type Canvas is not applicable for the arguments (RectF, int, float, Paint) PizzaView.java PizzaTimer/src/com/test line 94 Java Problem
The method drawArc(RectF, float, float, boolean, Paint) in the type Canvas is not applicable for the arguments (RectF, int, float, Paint) PizzaView.java PizzaTimer/src/com/test line 98 Java Problem
The method onMenuItemSelected(int, Item) of type PizzaTimer must override or implement a supertype method PizzaTimer.java PizzaTimer/src/com/test line 94 Java Problem
Thank you.
|
|
| Back to top |
|
 |
rejser Freshman

Joined: 16 Mar 2009 Posts: 5
|
Posted: Mon Mar 16, 2009 10:48 am Post subject: Re: The Pizza Timer - Threading/Drawing on Canvas |
|
|
| StGabe wrote: | Using sleep(1000) as a timer isn't going to give you a very good guarantee of accuracy. That just means the thread will sleep for at least 1000ms but it could well be more and your clock will tend to be slow (depending on how well threads are serviced).
It would be far better to use the system clock (that's what it's there for). To do this you would have your thread regularly polling System.currentTimeMillis(). Also, I would put the thread in PizzaTimer and get rid of the (IMO) clunky message passing. It's less code, it provides a general event loop that could be extended with other features (i.e. an animation) and IMO it's cleaner. |
Quoted for truth. The timer usage in the tutorial is really bad programming practice, even if it doesn't matter for a pizza timer if the actual time is off by several seconds at the end.
|
|
| Back to top |
|
 |
vhtmobile Freshman

Joined: 09 Apr 2009 Posts: 2
|
Posted: Thu Apr 09, 2009 8:45 pm Post subject: Error inmy pizza application |
|
|
Hi everyone,
I am very new to this android aplication development . I started to learn how to create an application .I found the pizza application and started working on it .
But I am not sure what are the values for
nm.notifyWithText(PIZZA_NOTIFICATION_ID, getText(R.string.pizza_notification_text),
NotificationManager.LENGTH_LONG, null);
I get error on NotificationManager.LENGTH_LONG cannot be resolved.
and I get error for item also.
public boolean onMenuItemSelected(int featureId, Item item) {
I tem cannot be resolved of type
and one more question what are the R.string values . Do I have to create the string variables with some values.
in string.xml
Please help me .
|
|
| Back to top |
|
 |
apple2183 Junior Developer

Joined: 10 Apr 2009 Posts: 24
|
|
| Back to top |
|
 |
vhtmobile Freshman

Joined: 09 Apr 2009 Posts: 2
|
Posted: Mon Apr 13, 2009 6:40 pm Post subject: regarding the link you provided |
|
|
Hi apple,
I tried to check the tutorial you gave but , I see all the tutorial is removed.
Can you please check if I am wrong.
Are you talking about the tutorial.
thanks
|
|
| Back to top |
|
 |
apple2183 Junior Developer

Joined: 10 Apr 2009 Posts: 24
|
Posted: Wed Apr 15, 2009 11:42 am Post subject: |
|
|
Hi
New people should register in that site
|
|
| Back to top |
|
 |
WarrenFaith Moderator

Joined: 13 Mar 2009 Posts: 227 Location: Berlin, Germany
|
|
| Back to top |
|
 |
|