Skip to first unread message
Assigned to kkas...@gmail.com by steve....@gmail.com

Aldric Jacquet

unread,
Jan 13, 2015, 8:05:55 PM1/13/15
to mitappinv...@googlegroups.com
sorry for mistakes if i make some, i'm french, i'll do my best.

i'm actualy building an apk using ai2 for my son, he is 4 years old, and had a lot of larynx surgery,
after 2 years at hospital, he is now at home, but his trachea is closed, he has a tracheotomy to breathe,
and so, he can't speak at all.
so i am making a app to click on pictures to make the android device talk, in app, i can add pictures and words or sentenses to be spoken by the device, 20 empty pictures slots per page, and the number of pages is endless.i add pictures or photos with image picker, and a text field and save it all with tinydb.


i am not a profesionnal at all, i know only bases, i'm not familiar with java so i' use app inventor.

i made a first apk with app inventor 1 last year,
i have been able to run localy the ai server and so modify the imagepicker.java file to remove the 10 pictures limit, it take me 3 weeks to manage to do it and understand how to use ant and to run localy. but it was ok, i had remove the 10 pictures limitation.

the mit pushed out  app inventor 2,
so now i have rebuilt my apk on ai2, i can run it on local i change the value from 10 to 9999, but i didn't manage to make it work...
 
i have dowloaded  the mit source,
i have modified the  "~\mit-cml-appinventor-sources-nls-593-g47174a7\mit-cml-appinventor-sources-47174a7\appinventor\components\src\com\google\appinventor\components\runtime\ImagePicker.java"  file,

// max number of files to save in image directory
  private static int maxSavedFiles = 10;
 
to

// max number of files to save in image directory
  private static int maxSavedFiles = 99999;
 
then i run ant to build server

i run the ai server
i run the build server

i then build the apk,

all seems to be ok,

but when i launch my apk on the device, i'm still limited to 10 pictures.

could you please help me ?

i found also a more easy way to run app inventor 2 localy with
ai2offline

at: http://sourceforge.net/projects/ailivecomplete/files/?source=navbar

the file is : Ai2Offline_16Dec14

but the imagepicker is into a jar file and is not in java but in .class file,

i can open the androidruntime.jar even decompile it, and access to ImagePicker.class,

turn the .class into .java, but it's impossible to recompile it after with javac, i get 43 errors, just by changin 10 to 99999.

i'm trying to make it ork for 2 weeks.

please help me.

best regards.
aldric

Taifun

unread,
Jan 13, 2015, 8:25:32 PM1/13/15
to mitappinv...@googlegroups.com
what about using this solution?
Taifun

SteveJG

unread,
Jan 13, 2015, 8:30:17 PM1/13/15
to
Hello Aldric.   There may be several ways to develop the app for your four year old.   One is the route you are on now; the other is to use a very different approach.  Regarding the route you are on, I sent a note to the guy who developed AILiveComplete...he might have some ideas.   Regarding a different path:


Did you know you can place an image in a button?
Did you know that using outside resources (a picture editor) you can reduce the size of images to Android screen size and then fit possiblly several hundred images in Media (resources).
The images can be selected using buttons and linked to a list of words that can be selected for the TextToSpeech control.

Something like this:


Set the TextToSpeech to vocalize the labels; add LOTs of buttons    using lists... and you do NOT need more than ONE screen because you can re-use the buttons with different images.
See the aia here 


Regards,
Steve
ImageButtons.aia

Aldric Jacquet

unread,
Jan 13, 2015, 8:49:22 PM1/13/15
to mitappinv...@googlegroups.com
thanks,
in fact, to explain you,
i don't include pictures in app,
i need to be able to add:remove: pictures easily,
he is going to shcool, so i need to update pics and text each days, depending on what he learn or need to be able say in class
my app is empty when you start it,
when you want, you just pick a picture or photo with ImagePicker, and also the text you whant to be spoken by texttospeech ,
you assign it to the button you want with long press on it,
there or 20 empty buttons on screen,

there is a normal mode where you can only click on pictures to make them speak,
and an  "edit mode"  password protected, to avoid accidental removing or deleting buttons by my son when using it
in this mode i can add as many pages i want ( 20 more buttons layout per page) and also rename pages, and edit pictures and text for the buttons
all is saved in tinydb

when i did it with appinventor 1, i have manager to modify the limit to 99999 instead of 10.
but i rebuild it from scrath in app inventor 2, and i'm stuck for 2 weeks trying to  run localy the server and modify the Image picker.
my only problem is the 10 pictures limit.

or maybe, idon't know, if it's  possible to modify the apk directly  instead of modding mit build server,
i can decompile apk with app2market or  apkoneclick, ut i can't find the " private static int maxSavedFiles = 10" anywhere..


 

SteveJG

unread,
Jan 13, 2015, 8:55:14 PM1/13/15
to mitappinv...@googlegroups.com
OK ... an idea, but your solution seems very interesting and seems more flexible.  Wait a bit and Hossein will probably send you some ideas and possibly might tell you how you might modify the imagepicker on a personal server.  

Thank you for the added details.

Good luck.    

-- Steve

Aldric Jacquet

unread,
Jan 13, 2015, 8:57:19 PM1/13/15
to mitappinv...@googlegroups.com
thanks,
i don't know,, it's a good trick,
but after, can i definitly assign the choosen pictures  to my buttons?

M. Hossein Amerkashi

unread,
Jan 13, 2015, 9:02:32 PM1/13/15
to mitappinv...@googlegroups.com
Aldric
On mobile now. Will check into this thread and will respond by tomorrow.

Taifun

unread,
Jan 13, 2015, 9:13:53 PM1/13/15
to mitappinv...@googlegroups.com
i don't know,, it's a good trick,
but after, can i definitly assign the choosen pictures  to my buttons?
sure, but why don't you just try it yourself?
Taifun

Aldric Jacquet

unread,
Jan 14, 2015, 2:04:52 AM1/14/15
to mitappinv...@googlegroups.com
thanks a lot.
i don't understand what i made wrong,and why it worked and App Inventor 1 and why i can't do it by the same way on A I 2.

as you build AI2live complete, maybe it is a really easy thing for you :-)


Aldric Jacquet

unread,
Jan 14, 2015, 2:23:49 AM1/14/15
to mitappinv...@googlegroups.com
lol i went to sleep, it was 3.00am when i post the message.

i have lot of blocks with variable entries for all buttons, so it's a hard thing to modify everything to replace ImagePicker with activity starter,
and i don't know how i possibly save variable buttons picture on tiny db,

i know my apk worked well with ImagePicker, on app inventor 1,
the ImagePicker.java source file is a little bit different from AI1 to AI2,  but the "  private static int maxSavedFiles =10" field is the same,


i hope mr Amerkashi  will have a solution, because his Ai2Offline_16Dec14 works pretty well, but the Image Picker is in .class, and i can't modify the field,
i've tried for a week, i have decompiled it with jdgui, then replace 10 by 99999, and after, i'm not able to recompile in .class,
"javac ImagePicker.java" give me 43 errors, and i'm not able to solve this.

maybe ifor Ai2Offline_16Dec14 i need the source code and "ant " it, i've tried to install Ai2Offline_16Dec14, then overwrite the folders with a modded buid server from ai2 source and then ai server and build server don't lauch anymore..

Taifun

unread,
Jan 14, 2015, 8:46:44 AM1/14/15
to mitappinv...@googlegroups.com
i have lot of blocks with variable entries for all buttons, so it's a hard thing to modify everything to replace ImagePicker with activity starter,
and i don't know how i possibly save variable buttons picture on tiny db,

this sounds like you have a lot of redundancy in your blocks...
now you have the opportunity to simplify everything!

read Enis' tips about redundancy here http://twodogapps.com/?page_id=686
and then use the example How to pick an image using the activity starter and modify it to your needs, which means, in the ActivityStarter.AfterResult event:
set Button.image to ActivityStarter.ResultUri
and: don't hesitate to try something!

Taifun

Aldric Jacquet

unread,
Jan 14, 2015, 9:11:36 AM1/14/15
to mitappinv...@googlegroups.com
no redundancy problems,
just lot of blocks. lol..

Aldric Jacquet

unread,
Jan 15, 2015, 4:57:16 PM1/15/15
to mitappinv...@googlegroups.com
it looks good,

after 2 days modifying all blocks linked to image picker and using activit starter, it works.

thanks to Taifun for the trick


i still would like to remove the image picker limit if possible.

Reply all
Reply to author
Forward
0 new messages