android
  #1  
Old 12-04-2010, 11:12 AM
visionary m visionary m is offline
Junior Member
 
Join Date: Dec 2010
Posts: 17
Default a paint app and a reader app

The paint app is my first program, and the reader is my second. I am sure that the coding is a little weird, but they work for the most part. Also any other comment's, ideas, suggestions, or criticisms are appreciated. Thank you jbob18 for realizing my error. The reader app is now up and running.

Tons of credit goes to Cilmaviel and habhome. In the paint app i used their idea to draw lines instead of individual pixels, ingenious idea. thank you guys.

note: the reader app now works fine of the xfi, you can now scroll through the text without tapping. to go to the next/ previous page hold on the bottom/top of the xfi screen.
Attached Images
File Type: png paint.png (36.7 KB, 229 views)
File Type: png reader.png (52.8 KB, 290 views)
Attached Files
File Type: zip paint.zip (3.3 KB, 315 views)
File Type: zip reader.zip (26.3 KB, 338 views)

Last edited by visionary m; 12-16-2010 at 06:01 PM. Reason: paint and reader fixed
Reply With Quote

Advertisement [Remove Advertisement]

  #2  
Old 12-04-2010, 11:31 AM
jbob182's Avatar
jbob182 jbob182 is offline
X-Fi2 Development Moderator
 
Join Date: Feb 2010
Location: The U.S.A.
Posts: 554
Default

If this is your first and second app, then wow. The apps are pretty good, as for crashing i found out, when you say: control.isButton()==1 it is checking for any, ANY type of event where that is button up or down or hold or relase

so change line 105 to

Quote:
elseif control.isButton()==1 and button.click() == 1 then
and the app will work, i must say these apps are quite compact , sure alot better than my first app (that was horrible but a good learning experience). Can't wait to see what else you make, after all it is not often we get another developer
Reply With Quote

  #3  
Old 12-04-2010, 02:53 PM
Habhome's Avatar
Habhome Habhome is offline
Moderator
 
Join Date: Jan 2010
Location: Sweden
Posts: 1,079
Default

Ok, here comes feedback!

Paint:
First off, check this application by Cilmaviel and me to get some inspiration, I think it's a stable version up, otherwise I have some back copies: Paint 1.7
And then, bugs.
1. Have you tried this on the player or only the sim? Because the sim is many times faster than the actual device. Because I get boxes drawn, not lines. It is simply not fast enough so the spacing is too wide, it's even drawing late.
2. The "large" label is constantly redrawn, it is noticeable by how it becomes "bold" after a while.

Reader:
1. I can only scroll one line at a time, and also if I only tap the screen it scrolls down. Here, study the code for Notee-fi and Notepad for further investigation.

In general:
Screenshots would be much appreciated and also, make some more distinct Icon for each application.

And lastly: Awesome job for the first time! My first application was a port of a Black Jack game I had made in Java before, I take it you know some other languages already?
__________________
"If you are good enough at English to apologize, then there is no need to." - A good friend of mine
Discovered something about the X-Fi2 you think others may not know? Post it here so others can learn about it!
Have a question about X-Fi2 apps? Consult the FAQ before creating a thread about it.
Like my work? Tell your friends. Don't like it? Tell me so I can improve. ^.^
Reply With Quote

  #4  
Old 12-04-2010, 11:25 PM
visionary m visionary m is offline
Junior Member
 
Join Date: Dec 2010
Posts: 17
Default

I am actually having some issues right now. The reader app works fine on the sim, but on the actual xfi, it only loads the program after quite a few tries to open it. if some one could help with that, that would be nice. Also i have tried the paint app on my mp3 player and noticed the lag, but i don't know how to fix it. I will look at the large button a little more closely though. About the reader app, i have a long ways to go to get to where i want to be. And i do have some past experience in programming, mainly in c and visual basic.
Reply With Quote

  #5  
Old 12-05-2010, 04:12 AM
Habhome's Avatar
Habhome Habhome is offline
Moderator
 
Join Date: Jan 2010
Location: Sweden
Posts: 1,079
Default

Quote:
Originally Posted by visionary m View Post
I am actually having some issues right now. The reader app works fine on the sim, but on the actual xfi, it only loads the program after quite a few tries to open it. if some one could help with that, that would be nice. Also i have tried the paint app on my mp3 player and noticed the lag, but i don't know how to fix it. I will look at the large button a little more closely though. About the reader app, i have a long ways to go to get to where i want to be. And i do have some past experience in programming, mainly in c and visual basic.
I don't have your code right now in front of me, so I can't for sure say anything about it. But for the paint app I guess it could be related to redrawing the screen too often, see if it isn't so that you call screen.update() too often, or with too big changes at a time (And yes, it takes lots of processor power for the player to redraw even if the prev image and the one added is the same, it doesn't filter that automatically, so it draws it all over again, which it does slowly)

In the Paint app I linked you to, which I have been tweaking slightly so I know the code in it, it uses lines to draw instead of boxes. It can still get ragged if you are too quick, but at least the lines are connected and not just look like dots.

Just some ideas from me in the morning.
__________________
"If you are good enough at English to apologize, then there is no need to." - A good friend of mine
Discovered something about the X-Fi2 you think others may not know? Post it here so others can learn about it!
Have a question about X-Fi2 apps? Consult the FAQ before creating a thread about it.
Like my work? Tell your friends. Don't like it? Tell me so I can improve. ^.^
Reply With Quote

  #6  
Old 12-05-2010, 08:32 AM
jbob182's Avatar
jbob182 jbob182 is offline
X-Fi2 Development Moderator
 
Join Date: Feb 2010
Location: The U.S.A.
Posts: 554
Default

for the lag i had this problem before and what you can usually do to help improve it is to not draw the bg but only what is being added to the bg( it goes alot faster with only small parts to redraw) and when the user lets go it will preform a full redrawing. This will help and if you use moving objects erase the objet by fillrecting the object with white and not redrawing the bg
Reply With Quote

  #7  
Old 12-06-2010, 04:20 PM
Brett_val's Avatar
Brett_val Brett_val is offline
Senior Member
 
Join Date: Jan 2010
Location: The Netherlands
Posts: 636
Default

Not sure why the reader app wouldn't open in the first instance, but there's one thing bothering me about the code: In function scrolling() it sets the text color and size everytime it writes a line:
Code:
for x = scroll - 15, scroll do
        text.color(red)
        text.size(12)
as far as I can see this is not needed and you only have to set it one time for the whole app, together with the stuff on the first lines.
It's just a detail though

About the lag in the paint app, isn't that the same lag that cilmaviel encountered in this paint app? Besides that I can't think of anything else, maybe reduce the os.sleep() a bit since 100 milliseconds is quite a lot, but I don't think that should matter too much in this case.

Nice apps by the way, I like how compact and to the point they are .

ps the redrawing of the text "large" is in function selectbox(), I think you can just remove that line.
__________________
this is a link to my personal homepage which I haven't

Last edited by Brett_val; 12-06-2010 at 04:35 PM.
Reply With Quote

  #8  
Old 12-06-2010, 11:53 PM
visionary m visionary m is offline
Junior Member
 
Join Date: Dec 2010
Posts: 17
Default

thank you brett. at the time that i posted the code i wasn't sure about the text color and size stuff. I reposted both of the apps earlier and added the ability to scroll to the reader, and instead of drawing individual pixels in the paint, i changed it to lines, so that reduced the lag by a major leap. as for the sleeping, i will try to keep that at a minimum in my later works.
Reply With Quote

  #9  
Old 12-09-2010, 02:55 PM
Handover Handover is offline
Junior Member
 
Join Date: Dec 2010
Posts: 1
Default

thank you brett
Reply With Quote

  #10  
Old 06-28-2011, 02:37 PM
jameswalker101 jameswalker101 is offline
Junior Member
 
Join Date: Jul 2010
Location: United Kingdom
Posts: 91
Default

nice apps, but could you improve the graphics on paint? prehaps gradients on the color select box?
__________________
Apps: Guitar Tuner- http://anythingbutipod.com/forum/showthread.php?t=61049
Reply With Quote

Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump



All times are GMT -5. The time now is 01:07 AM.