Page 1 of 2 12 LastLast
Results 1 to 20 of 37
  1.    #1  
    Hi all,

    My app have many pictures and to decrease the size of the ipk file i want to split it in 2 parts:
    The #1 part will be the code installed on /var/usr/applications (as palm-package do it)
    The #2 part will be all pictures installed on /media/internal/myapp

    To test if this structure works in my app, i create manually the folder myapp connecting my Pre in USB mode and put all pictures in it.
    It works fine, pictures are correctly displayed.
    This solution is efficient because the space available for apps on a Pre is very limited.

    My question is, how to create an ipk that creates automatically the folder myapp under /media/internal during the install process ?

    Or is there a way to do it without the user creates manually this folder ?
    The goal is to provide to user an easy solution to install my app.


    Thanks for your advices ?
    _________________________________________________________
    Ze-Palm
    is ZE #1 innovative software solutions for PalmOS and Palm webOS.


    _________________________________________________________[/COLOR]
  2. #2  
    Quote Originally Posted by Ze-Palm View Post
    Hi all,

    My app have many pictures and to decrease the size of the ipk file i want to split it in 2 parts:
    The #1 part will be the code installed on /var/usr/applications (as palm-package do it)
    The #2 part will be all pictures installed on /media/internal/myapp

    To test if this structure works in my app, i create manually the folder myapp connecting my Pre in USB mode and put all pictures in it.
    It works fine, pictures are correctly displayed.
    This solution is efficient because the space available for apps on a Pre is very limited.

    My question is, how to create an ipk that creates automatically the folder myapp under /media/internal during the install process ?

    Or is there a way to do it without the user creates manually this folder ?
    The goal is to provide to user an easy solution to install my app.


    Thanks for your advices ?
    You will need to create an ipkg with a post-install script, which will only be installable by advanced homebrew installers like Preware.

    -- Rod
    WebOS Internals and Preware Founder and Developer
    You may wish to donate by Paypal to donations @ webos-internals.org if you find our work useful.
    All donations go back into development.
    www.webos-internals.org twitter.com/webosinternals facebook.com/webosinternals
  3. #3  
    keep in mind advanced homebrew apps won't be allowed in the AppCatalog, so it might just be best to either:

    - included the imaged in the ipk with the app files and wait for the alleged end of app limit, rumoured on 1.3.5

    - host the images on a web server and hotlink or download them as needed.

    also, keep in mind images in /media/internal/ will be indexed into the photos app, and filepicker widhet
  4.    #4  
    Thanks Jason and rwhitby for your replies.
    I read many posts (many of them are written by you) to learn myself about how it works and how to create an ipkg.
    ipkg seems to be the solution in my case but it needs some advanced knowledge and it's not without risks !

    The other solution as Jason said is to include all images in the ipk.
    The version i provide to user is actually packed with this principle.
    The problem is that the ipk size is 25 Mo and when i sync it via WebOSQi the transfer seems correct (no errors) but there is nothing on my Pre !!

    If i root my Pre using WinSCP there is no folder corersponding to my app in /var/usr/palm/applications.
    If i root my Pre using WinSCP and if i create a folder then copy all subfolders and files corresponding to my app, all is fine. I'm able to run my app on my Pre.

    I conclude that there is a size limit for an app synched, maybe 10 Mo or something like that.

    As you are WebOS guru, what are your advices about this behaviour ?
    Have you encounter this kind of problems and have you solution ?

    Thanks for your help.
    _________________________________________________________
    Ze-Palm
    is ZE #1 innovative software solutions for PalmOS and Palm webOS.


    _________________________________________________________[/COLOR]
  5. #5  
    What risks are you referring to?

    -- Rod
  6. #6  
    let's try it a different way:

    You have three choices:

    1) You can write this as a "homebrew only" app, which will require a "post install" script to be run to move the picture files to /media/internal/myapp

    If you do that, you will not ever be able to submit it to the app catalog. Additionally, if you do that, your app's pictures will be visible in the photo viewer app, which displays every picture in /media/internal

    2) you can just put the pictures in the normal place. For the app catalog, the app has a limit of 5 meg for the IPK.

    3) you can download the photos AFTER you install the app. This works, and avoids the app catalog problems above, and after all, you can't INSTALL the app without downloading it, so your user HAD to have a net connection anyway. Just download the pictures using the download service on first use.
  7.    #7  
    Thanks all for your replies.
    What risks are you referring to?
    No particular risk but i read that some users speak about, maybe for complex solution.

    rboatright, your 3 choices are very explicit. I confirm that
    your app's pictures will be visible in the photo viewer app
    AND in any app or feature which use pictures such as the feature "change wallpaper".

    Your choice 2, my app is yet in the App Catalog !!.The limit is up to 200 Mo

    Your choice 3 is interesting. If i well understand, it requires a "post-install" script

    I hope that Palm fix it in the next WebOS version as Jason Robitaille said.

    So, a "post install" script could be the solution.
    To create this "post install" script, what are the command lines to write in this script and what is the method to create a ipkg file ?

    Thanks for your help.
    _________________________________________________________
    Ze-Palm
    is ZE #1 innovative software solutions for PalmOS and Palm webOS.


    _________________________________________________________[/COLOR]
  8.    #8  
    If I analyze my problem, it may be due to 2 reasons:
    - Synchronization via WOSQI fails because it does not accept applications size exceeding a certain limit.
    - Either the sync is correct but the internal process of installing the ipk on the Palm fails

    How can i do to identify what is the real reason ?
    Is there any analysis tools ?

    if you are interested, i can provide you this large ipk.

    Thanks for your advices.
    _________________________________________________________
    Ze-Palm
    is ZE #1 innovative software solutions for PalmOS and Palm webOS.


    _________________________________________________________[/COLOR]
  9. #9  
    you mis-understood me on option 3.

    You can use the webOS download service to have YOUR APP download your pictures on first use.

    No post-install required.

    As Jason said, Palm has announced that with the release of 1.3.5, the space problem for apps will be going away. We are not at liberty to discuss the details of that yet under NDA. Sorry.
  10. #10  
    Just wanted to note that you can hide images from photo viewer by prefixing them with . or putting them in a directory prefixed by .

    For example Virtual Keyboard images are stored at /media/internal/virtual-keyboard/.themes/

    -Eric G

    WebOS Internals Developer.
    Follow me on Twitter for updates to my projects: | Virtual Keyboard | wIRC | SuperTux | AUPT | KeyBoss | freeTether |

    Donate
  11. #11  
    Quote Originally Posted by scottr1 View Post
    Interested in this topic, what is the "webOS download service" rboatright ?
    .
    Download Manager – webOSdev – Palm
  12.    #12  
    Sorry for my misunderstanding rboatright ( i mixed the different options )

    So, your advice to check if picts are downloaded in the first use using the DL service is the right solution.
    Thank you emoney_33 for your tip, it works fine.

    I give a try to code the webOS DL Service but it not works !
    The approach i used is to check if a pict exists on the folder /media/internal/.mydir and if not the DL service download it from my server (ht*p://www.url.com/) and copy the pict on /media/internal/.mydir.

    Here is the code :
    First assistant is the first scene of my app
    Code:
    //--- If pict Exists on /media/internal/.mydir
    FirstAssistant.prototype.PictExist = function(){
    	......;
    };
    
    //--- If pict NOT Exists on /media/internal/.mydir
    FirstAssistant.prototype.PictNotExist = function(){
    	this.controller.serviceRequest('palm://com.palm.downloadmanager/', {
    	 method: 'download', 
    	 parameters: {
    	 target: "http://www.url.com/",
    	 "mime" : "img",
    	 "targetDir" : "/media/internal/.mydir/",
    	 "targetFilename" : "Pict1.png",
    	 keepFilenameOnRedirect: false,
    	 subscribe: true
    	 },
    	 onSuccess : function (resp){
    	 	Mojo.Log.info(resp.ticket)
    		},
    	 onFailure : function (e){
    	 	Mojo.Log.info(Object.toJSON(e))
    		}
    	 });
    };
    
    
    FirstAssistant.prototype.activate = function(event) {
    //--- Test if a pict exists
    			var existpict = '/media/internal/.mydir/Pict1.png';
    			var request = new Ajax.Request(existpict, {
            		method: "get",
            		onSuccess: this.PictExist.bind(this),
            		onFailure: this.PictNotExist.bind(this)
        		});
    }
    I code the test in the activate block or in the setup block but DL service not works.

    So, my questions are :
    - Where i'm wrong in my code ?
    - How can i download all files that are in a folder and subfolder instead of download individually each file ? My app has more than 200 images !!

    The structure of all my picts are :
    images (folder)
    ...pict1 (file)
    ...pict2 (file)
    images/Database (Database is a subfolder of the folder images)
    ...........pict3 (file)
    ...........pict4 (file)



    Thanks for your suggestions.
    Last edited by Ze-Palm; 12/27/2009 at 11:23 AM. Reason: link in code
    _________________________________________________________
    Ze-Palm
    is ZE #1 innovative software solutions for PalmOS and Palm webOS.


    _________________________________________________________[/COLOR]
  13.    #13  
    After many hours I fix the error in my code and i can download a file !! (thanks to PreCentral forum and Palm webOS forum to find the solution)

    Here is the code :
    Code:
    new Mojo.Service.Request('palm://com.palm.downloadmanager/', {
    	method: 'download',
    	parameters: { 
    	target: url + "Pict1.png",
    	"mime": "img",
    	"targetDir": "/media/internal/.mydir/",
    	"targetFilename": "Pict1.png",
    	subscribe: true
    	}, 
    	onSuccess: function(resp){ 
    		if (resp.completed == true) { 
    			Mojo.Log.info('RESPONSE Success: ' + Object.toJSON(resp));
    			} 
    		}, 
    	onFailure: function(e){ 
    		Mojo.Log.info("Failure download.")
    		} 
    	})
    My question is, is there a way to download all files they are on the url without coding for each file all these lines ?

    Thanks for your help.
    Last edited by Ze-Palm; 12/27/2009 at 11:29 AM.
    _________________________________________________________
    Ze-Palm
    is ZE #1 innovative software solutions for PalmOS and Palm webOS.


    _________________________________________________________[/COLOR]
  14.    #14  
    up !
    Anybody try to download a list of files ?
    _________________________________________________________
    Ze-Palm
    is ZE #1 innovative software solutions for PalmOS and Palm webOS.


    _________________________________________________________[/COLOR]
  15.    #15  
    Up again !!
    I repeat my question: Is there a way to download all files which are in a folder stored on a server ?
    .
    _________________________________________________________
    Ze-Palm
    is ZE #1 innovative software solutions for PalmOS and Palm webOS.


    _________________________________________________________[/COLOR]
  16. #16  
    I guess one way to do this would be to create a small script on the server that hands the pre a list of files to download, and then looping through the list using the downloadmanager service. I haven't tried it, but I'm fairly positive that it should work.
  17.    #17  
    I tought to apply this principle to parse the list of files to be downloaded.
    I create a json file which contains all the files then load and loop it but it not works.
    My problem is to read each element with the array (i) during the loop.

    here is the json file:
    Code:
    {
         "File1": "filename1",
         "File2": "filename2",
         "File3": "filename3",
         "File4": "filename4"
    }
    Here is the OnSucess code:
    Code:
    InitAssistant.prototype.OnSuccess = function(transport) {
       	var r = transport.responseJSON;
    	
    	for (i = 1; i < 5; i++)
    	{
    		this.filename=r.File+(i);
    		this.controller.get('filename').innerHTML = this.filename;
                    ...... here is the Download Service manager code ....... 
    	}
    }

    How to set correctly each element during the loop ?
    When i=1 Then this.filename must be r.File1
    When i=2 Then this.filename must be r.File2
    .....

    If there is another more efficient way to do it, i'm interested in

    Thanks for your help.
    _________________________________________________________
    Ze-Palm
    is ZE #1 innovative software solutions for PalmOS and Palm webOS.


    _________________________________________________________[/COLOR]
  18. #18  
    Quote Originally Posted by Ze-Palm View Post
    [..]
    here is the json file:
    Code:
    {
         "File1": "filename1",
         "File2": "filename2",
         "File3": "filename3",
         "File4": "filename4"
    }
    [...]
    If there is another more efficient way to do it, i'm interested in
    Thanks for your help.
    Here's 2 options:
    1. Access the json as it is formatted above like:
      Code:
      this.filename=r['File' + i];
    2. Alternatively, you could have the list of filenames sent in the form of an array:
      Code:
      {
           "Files": ["filename1", "filename2", "filename3", "filename4"]
      }
      Then call it like:
      Code:
      this.filename=r.Files[i];

    Either should work, I believe
    If you've liked my software, please consider to towards future development.

    Developer of many apps such as: WebOS Quick Install, WebOS Theme Builder, Ipk Packager, Unified Diff Creator, Internalz Pro, ComicShelf HD, LED Torch, over 70 patches and more.

    @JayCanuck @CanuckCoding Facebook
  19.    #19  
    Thanks Jason Robitaille for your advices.
    I fixed it using array and looping the list using the downloadmanager service.
    Here is the json file. This list contains 50 filenames
    Code:
    {
        List: [
            {File: "filename1"},
            {File: "filename2"},
            {File: "filename3"},
            {File: "filename4"},
            {File: "filename5"},
            {File: ".............."},
            {File: "filename50"}
        ]
    }
    Here is the code after reading the json file
    The number of files to download is 200 because each file has 4 different extension.
    So in my code i must perform 4 "Download Manager Service" in order to download each type of extension.

    Code:
    InitAssistant.prototype.ReadSuccess = function(transport){
    	var r = transport.responseJSON;
    	var state = [];
    	var url1 = "http://www.mysite.com/myappdir/";
    	var targetdir = "/media/internal/.myappdir/";
    	
    	for (i = 0; i < 50; i++) {
    		Type1[i] = r.List[i].File;
    		Type2[i] = r.List[i].File;
    		Type3[i] = r.List[i].File;
    		Type4[i] = r.List[i].File;
    		this.extension1 = Type1[i];
    		this.extension2 = Type2[i];
    		this.extension3 = Type3[i];
    		this.extension4 = Type4[i];
    		
    //--- Download file with extension1
    try {
    	new Mojo.Service.Request('palm://com.palm.downloadmanager/', {
    		method: 'download',
    		parameters: {
    		target: url1 + this.extension1 + ".ext1",
    		targetDir: targetdir,
    		targetFilename: this.extension1 + ".ext1",
    		subscribe: true
    		},
    		onSuccess: function(response){
    			if (response.completed) {
    				$('filename').update('Extension1 downloaded.');
    			}
    		},
    		onFailure: function(error){}
    	})
    } 
    	catch (error) {}
    		
    //--- Download files with extension2	
    try {
    	new Mojo.Service.Request('palm://com.palm.downloadmanager/', {
    		method: 'download',
    		parameters: {
    		target: url1 + this.extension + ".ext2",
    		targetDir: targetdir,
    		targetFilename: this.extension2 + ".ext2",
    		subscribe: true
    		},
    	       onSuccess: function(resp){
    			if (resp.completed) {
    				$('filename').update('Extension2 downloaded.');
    			}
    		},
    		onFailure: function(error){}
    	})
    } 
    		catch (error) {}
    //--- Download files with extension3
    ....................................
    ...........................
    //--- Download files with extension4
    .........................................
    		onSuccess: function(respdata){
    			if (respdata.completed){
                                Mojo.Controller.stageController.pushScene("First");
    			}
    }
    I tested if it works on emulator and noticed that all files are not downloaded.
    I check it connecting the emulator using WinSCP.
    There are only 120 or 150 files ! It depends.
    It seems that the "First" scene is pushed when one of the 4 DM service block is completed.

    I try different syntax to force to finish properly each DM service block but the result is not correct. All files are not downloaded.

    How can i do to download correctly all the files ?
    Is there something wrong in my code or do I use specific syntax ?

    Thanks for your help.
    _________________________________________________________
    Ze-Palm
    is ZE #1 innovative software solutions for PalmOS and Palm webOS.


    _________________________________________________________[/COLOR]
  20. #20  
    I would remove the try {} catch {} code blocks so that any errors in the code is printed out and not ignored. Also, you should use Mojo.log to print errors in the system log, which you can view by running "tail -f /var/log/messages" on the emulator.
Page 1 of 2 12 LastLast

Tags for this Thread

Posting Permissions