I am working with a huge xml file(1.3 mb) from server, it takes about 25 seconds to download from server.
I am getting coordinates from the server. I have to draw them on the screen, so is there a way I can lazy load the view?
I am able to download the xml file and store it in the internal memory and parse it using the SAX parser.
Also can I download the xml in chunks and parse them as I go on?
To Elaborate my problem,
1. I need to download and parse an xml file from the server. The file is roughly 1.3 MB
2. It takes about 30 seconds to download and 4 seconds to parse.
3. I am storing it in a local file and parsing it using SAX parser.
4. In this xml file I am getting the drawing points from which I recreate a drawing on a canvas.
So is there any way I can work on the drawing part as the xml file is being downloaded and parsed on the chunk of downloaded file to minimize the delay and parse smaller segments from the server?
I'm not sure what kind of view/data you're talking about (MapView?) but you have to show something while the download and parse operation takes place.
The Android design guide suggests showing a centered ProgressBar, which they refer to as an "Activity circle". After the operation is complete, hide the progress bar and show your view instead (use a FrameLayout to overlap the "waiting" and "ready" views so you can easily switch between them by changing the visibility).
In this example, an activity circle (in Holo Light) is used in the
Gmail application when a message is being loaded because it's not
possible to determine how long it will take to download the email.
When displaying an activity circle, do not include text to communicate
what the app is doing. The moving circle alone provides sufficient
feedback about the delay, and does so in an understated way that
minimizes the impact.
Related
We are trying to develop a website for tracking the progress of pipeline and assets. I want to link progress data entered from forms developed in Java to GIS. We will be capturing all the lat and longs of pipeline stretch and lat and log of progress of work.
I need help in developing shapefile dynamically based on the progress and also to view that shape file in my webpage
The javascript API does have functionality for uploading shapefiles form your desktop into the browser, but you will need another tool to create those shapefiles based on the progress.
For uploading the shapefiles, see the example here: https://developers.arcgis.com/javascript/3/jssamples/portal_addshapefile.html
There may be more examples available at https://developers.arcgis.com/javascript/3/.
For creating the shapefiles dynamically, you could use ArcMap or ArcPro if you have those, or one of many python libraries to help write shapefiles. There may even be some Java libraries to help with this as well but I only work on the front end so I cannot help you there.
For something simple in context, the complexity of what kind of workflow to best suite your needs can range depending on these questions (and probably others I'm not thinking of):
Do you absolutely need to create a shapefile for this? Why can't you just push the form to a spatial database (e.g. PostGIS) and then return the XYs of the points or the string of XYs for line features, etc.?
Where is the source of the data & what is the format? Is it a PDF, text on an HTML page, a .csv file downloadable from a page, etc.? You may need to implement scraping (from a site) or download and update, or your data could be live streaming - these are all different workflows and you need to establish these boundaries before setting up your workflow.
If your end game are points, all you need is XYs in a table format to display in GIS software. If they are lines or polygons, it'd be a little different. Again - what output type are they and what are you trying to do with it (e.g. import into QGIS)?
Without these answers, it doesn't make sense for anyone to suggest something to you that could be totally impossible for you to execute. Please answer these and think through your workflow from beginning to end and/or visa versa.
Cheers,
Shawn
I want to represent a business process that I will have from an XML file and represent it in a JPanel, and I need also to visualize its evolution in time by changing colors (for example).
Do you know from where I should start, or if jBPMN can be connected to java and represented in my interface.
Any help will be appreciated.
The jBPM web designer can generate a PNG or SVG from an XML file (either by exporting as PNG or you can automatically save the SVG next to the process in the workbench repository when you save the process in designer. Your JPanel could retrieve this process PNG or SVG, and annotate it by first querying the current state of your process (from the engine or the audit tables directly) and using that to highlight certain nodes for example.
For the next version of jBPM we're working on a REST call that would automate all of that for you.
I think I am going to use JGraphix to draw my bpm, because as I saw, it give the possibility to draw shapes like bpmn ones.
I didn't see if it allows to change the color of the task case after x minut, but I guess it's going to be possible, and it's going to be the way to represent the evolution of the process at run time.
Do you think it's an Ok idea ?
I created about 10 different projects in adobe premiere to create video sequences of 4 images with an audio in the background and the text on the images. The duration of the clip is 30 seconds. The problem is that I have to create more than 1,000 videos of different image sequences. I thought about creating a script in C or Java or any other programming language to automate this: in practice the script should copy the images to a folder start the rendering and when finished go to the next slide. I found nothing. Someone knows how to help?
You might want to consider using an entirely commandline-based process instead of trying to use Adobe Premiere. This would allow it to be easily scripted.
FFMpeg is a commandline tool allows you to create a video from a sequence of images -- one image for for each frame of the video. You can also mix-in your audio file with FFMpeg. The hardest step will be generating images that have the proper text superimposed.
For more info on using FFMpeg you can start with an example like this:
https://lukecyca.com/2013/stop-motion-with-ffmpeg.html
I was wondering if it was possible to run an application on Android that will receive XML files during runtime, where these newly received XML files will then be rendered to the screen (will be shown as layout/view/string).
I was thinking that maybe you could add the newly received XML file to your res folder, but I don't think it'll change much since the generated R class will not be updated when the application is already compiled.
I have also thought of implementing my own XML parsing and rendering, but that would pretty much be like rewritting the entire render mechanism of Android.
Need help!
It will then display on screen the XML data using Android rendering (it should render it as if home_layout.xml was in the res folder)
LayoutInflater does not support anything but layout resources. You would need to write your own layout inflation logic from scratch. Given that you create your desired View hierarchy from the XML, the actual rendering would be no different than if the layout had been inflated from a resource.
What would be some ways to create an application that goes and fetches images (using URIs, that's the only way I've come across) so that the app's company can change the images without requiring alterations to the android code?
I've looked at URL redirection but it does not seem quite reliable.
(Each time the app starts, it goes and fetches the image for display)
Your app would pull images from
http://company.comm/images/1
http://company.comm/images/2
...
http://company.comm/images/n
and you would have a website/service that would allow to upload and set live images.
Using the Tumblr API achieved what I desired. It allows the fetching of the 6 most recent posts of a particular blog as JSON data. Recursively parsing the JSON received allows the program to dig in and use the URLs for a particular resolution.