WebView help needed - Android Software Development

Hi guys and gals I am having a issue with my app I'm making. The app uses webview to load a special web page to let a user download files mostly .pkg files but some zip files and exe's as well. I have the app built and it loads the website url I need it to but when I click on a file to download it to the storage card it does nothing at all. I know I need to do something with the DownloadListener I'm just not sure what or how. The snippets of code I have found on the net to try to understand it has not worked. I have given permission to the net and SD card in the manifest file. Any help with this would be great Thanks
p.s. for some reason it wont let me post my code. if anyone can help + rep for you

No one on this? ok well I know I need to set up a downloadlistener but I am unsure how to do this everything I have found is only to force media to be played somewhere but I need to just make it download the file to the root of the sdcard. any help even to a good tutorial or link with a code snippet for a different file type that i could modify to work would be very helpful

Related

Can anyone test this .apk for me?

Basically all I want is to test this Shop Savvy. Just download this .apk file, try to install it on your phone and tell me if it works. Here is the direct download link: http://dl.getdropbox.com/u/594052/Android/com.biggu.shopsavvy.apk
If you want to know the details, just go there -> click and read all the posts starting with this one #758
Thanks in advance for the reports. Oh, I need people who don't have the apps on sd.
All you need is the .apk file and this is how the backup applications work.
and if you have a file manager apk, all you need to do is click on the apk file and it'll install itself. (no need to adb push)

Portable Webserver for APK files

Hi guys,
I have just been playing around with the idea of hosting a webserver on my machine that my phone could connect to to download apk files after performing a wipe.
Iv been thinking about this as everytime i wipe my phone i connect back to the market and download appmanager to install apps direct from sd. So instead of having to do that im looking at having them all in a directory on my PC/Flashdrive (as this will be portable) using XAMPP.
Before any gets any wrong ideas this is not intended for any illegal doings. Its just to make my life easier. I thought i would share what i have started to see if this will help out anyone else.
So far i have it working (very rough). But i dont know any coding so this is a bit of a hack job.
I am using XAMPP as stated aswell as a PHP script that will automaticly populate the page will all files within a particular folder.
I have attached the index file i am using.
if you wish to use this please make sure you do a few things.
Install XAMPP
From where you installed XAMPP. In the HTDOCS folder create a "APK" Folder
Place the index.php in the HTDOCS folder
Edit the index.php file to change the path of the APK folder (currently set to D:\\Dream\\xampp\\htdocs\\APK) keep the double slashes "\\"
Start the Apache webserver from the XAMPP control panel
Now connect to Localhost, any files you place in that folder should now appear
Anyone wishing to use this, edit this, whatever you feel like. Go ahead
If you would like to help and change the look and feel of the page it would be greatly appreciated. If you do post the files back up here for all to use
Hope you guys like
Can I ask why you wouldn't just backup your apps to your sdcard (use something like MyBackup) and be done with it?
You can always copy them from your sdcard to your flash drive (and back from flash drive to sdcard temporarily if you need to re-install).
I'm all for experimenting, learning and even playing around a lot. But this seems like overkill. First off, your apps will surely get outdated quickly, and you'll end up upgrading lots of apps. You'll end up spending an enormous amount of time managing your own local library.
Personally, I think you're wasting your time unless your trying to learn how to do something in the process. Maybe you are, and in that case, go for it. Otherwise, enjoy your phone and let the Market do the management for you.
Or you can just have all your .apk's in a folder and use adb to install all of em at once. But like the above post you might have to get updates for alot of em.

Starting Runtime.exec() directory

Could someone tell me what path runtime.exec commands start in? I'm making a simple JIT program and I already have the enabling in the build.prop done, I just need to copy some files from the resources folder. Also can anyone provide input as to wether that would be legal to put on the android market as it would contain some dalvik files? If not, I know some apps get around it by downloading the files to sdcard which would be fine for me but I'm unsure how I'd do this in an android program. Thanks for any help!

Anyone proficient with PHP?

I'm trying to accomplish something in php format and I'm stuck.
I don't want to go into too much detail because I'm trying to surprise a friend on here so I will only go into specifics via pm but here's what I got so far:
I dl'd the eclipse PHP environment and the Zend debugger, got it all set up just fine (I think, lol)
I'm trying to edit an existing .php and with Treve's help was able to determine just exactly what I needed to edit. But I can't figure out how to "play" the code so I can see the changes, or even the original.
When I go to play the .php thru the web portal I only get code, it sees the file and displays it but doesn't convert it to the format I'm looking for, it just shows a large part of the page in plain text.
Any help would be greatly appreciated.
I will owe you one, or two maybe (and I'll actually pay up on it!!).
Please PM me if you need/want specifics. If there is something I am obviously missing then please help me out.
Thanks!
neb
wish i could help
regaw_leinad said:
wish i could help
Click to expand...
Click to collapse
Move along regaw, nothing to see here...
Anyone else? Anyone... anyone? Bueller?
i'm taking a php class and i know < ? p h p
i think thats right??? lol...
Not real proficient in it, but I figured if I can learn PHP in three weeks to allow me to build a web report group builder for the company I work for, I might be able to help.
First, which web server are you using? Apache, IIS or something else? The answer to that question depends on what happens next.
nebenezer said:
I'm trying to accomplish something in php format and I'm stuck.
I don't want to go into too much detail because I'm trying to surprise a friend on here so I will only go into specifics via pm but here's what I got so far:
I dl'd the eclipse PHP environment and the Zend debugger, got it all set up just fine (I think, lol)
I'm trying to edit an existing .php and with Treve's help was able to determine just exactly what I needed to edit. But I can't figure out how to "play" the code so I can see the changes, or even the original.
When I go to play the .php thru the web portal I only get code, it sees the file and displays it but doesn't convert it to the format I'm looking for, it just shows a large part of the page in plain text.
Any help would be greatly appreciated.
I will owe you one, or two maybe (and I'll actually pay up on it!!).
Please PM me if you need/want specifics. If there is something I am obviously missing then please help me out.
Thanks!
neb
Click to expand...
Click to collapse
tkirton said:
Not real proficient in it, but I figured if I can learn PHP in three weeks to allow me to build a web report group builder for the company I work for, I might be able to help.
First, which web server are you using? Apache, IIS or something else? The answer to that question depends on what happens next.
Click to expand...
Click to collapse
Apache2
And I just realized I apparently need GIFEncoder, reading up on it...
uhmm ill take a stab at it, i can probably guess what you're trying to set up by why you are needing but you want to be secretive. if you are using a decent webserver gifencoder should be installed. if you are running a script on a server you set up on your local pc then maybe you havent installed php correctly or it may not be running that why its coming up as txt in your browser.
edit: i see you installed zend, so youre running a server on your pc. im willing to bet you havent started the php service.
i have some webspace i havent used for years if you want some space let me know, u can run the script there
Bonified PHP Guru here... send me a PM and I will see what I can do to help.
I too am a php programer. Your issue is that to don't have the php integrated into your web server correctly best way to solve that would be to find some one that can host the app for you. I currently have my own servers at several co-location sites all running php and can let u use for a while
Download and install XAMPP web server, it's easy, free and works great. Then you can veiw your changes.
Yes install xampp and you will get a server running in no time ... just copy your php to inside the apache folder.
Thanks guys!
Only PHP thread on XDA??
I was searching to see if anyone has managed to compile PHP cli for rooted Android devices, and the only result I found is this thread ...
So I installed xampp, very neat program, but I can't figure out how to use it right.
I'm not sure what I'm doing wrong...
localhost takes me to the xampp screen and myadmin screen works but when I try opening the php in the browser I get "object not found", and the icon on the browser tab switches from the xampp icon to the Zend icon even though I've uninstalled Zend
xampp says Apache and MySQL are running.
Also I went with eclipse-php. I've set up a galileo w/ adt successfully but have not done something right in the php install, I can't create working php projects or files.
I edited and saved as php in notepad++, if anyone wants to check it out and try to get it to execute please let me know
Any help would be appreciated
Thanks
nebenezer said:
localhost takes me to the xampp screen and myadmin screen works but when I try opening the php in the browser I get "object not found", and the icon on the browser tab switches from the xampp icon to the Zend icon even though I've uninstalled Zend
Click to expand...
Click to collapse
It sounds like you need place the php file into the working root directory for XAMPP. You may even need to rename the php file as index.php and place that in the root.
I think you are just trying to open the php file from your file explorer. The php file needs to be in the web root directory and you access it like you would a webpage. ( http://127.0.0.1/YOURFILE.php ) <--- but like I said it needs to be in the webroot directory.
centran said:
It sounds like you need place the php file into the working root directory for XAMPP. You may even need to rename the php file as index.php and place that in the root.
I think you are just trying to open the php file from your file explorer. The php file needs to be in the web root directory and you access it like you would a webpage. ( http://127.0.0.1/YOURFILE.php ) <--- but like I said it needs to be in the webroot directory.
Click to expand...
Click to collapse
Thank you,
I tried your suggestions to no avail. I put the file in (separately, not multiple copies) c:\, c:\xampp and c:\xampp\php and always get the error.
I tried renaming the file index.php, same error
I need to put this on the shelf for a bit and do something productive...
Thanks for your help guys!
nebenezer said:
Thank you,
I tried your suggestions to no avail. I put the file in (separately, not multiple copies) c:\, c:\xampp and c:\xampp\php and always get the error.
I tried renaming the file index.php, same error
I need to put this on the shelf for a bit and do something productive...
Thanks for your help guys!
Click to expand...
Click to collapse
The correct directory for xampp is in htdocs.
damageless said:
The correct directory for xampp is in htdocs.
Click to expand...
Click to collapse
Tried that one also.. BUT I didn't try it after renaming to index.php
One more shot!
*edit, still just getting raw code, which I suppose is better than an error code
thanks damage
pm me your php script. probably best to just pastebin.ca it. If it is showing you the code after putting it in the htdocs directory that means you found the right directory. Usually when php is not configured correctly on your web server it doesn't just show you the code, the mime type is not recognized and offers it as a download. So your browser would try to download "index.php" or whatever instead of just showing you raw php.
hahhaah.. I know what you're up to....
Here's how I did it before your modifications you're working on: http://i0v.net/matrix/

How to host an .apk file?

Hi!
I've been trying to upload an .apk to my webhost (through ftp) and when I try to download it through the given url, the file doesn't download. Instead I only get text, just as if my host don't understand the file.
Any idea how I can fix this? Is it though .htaccess or what? /:
(I've tried to search this but with no luck)
First off I don't know too much about ftp but from what I do know I would imagine what you want to do would involve the .htaccess file in the apk's directory
My guess would be in the .htaccess file you'd have to edit/add the FilesMatch line
(if that doesn't work it may me just "Files" instead of "FilesMatch" - not sure)
Code:
<FilesMatch "\.(apk)$">
ForceType application/octet-stream
Header set Content-Disposition attachment
</FilesMatch>
Other alternatives I can think of are either:
Change the link from [B]ftp[/B]://your.ftp.org/blah/android.apk to [B]http[/B]://your.ftp.org/blah/android.apk when you give it out - but I realize this kinda defeats the purpose of using a FTP in the first place
Upload the .apk into a zip. That should force the 'save as' dialog
Hopefully this does the trick for you
**I hope this post looks correct - adding the html myself I may have messed up somewhere along the line, if it you see /LIST] or anything like that I'll fix it when I have access to a computer **
Sent from my Android using Tapatalk
kyouko said:
First off I don't know too much about ftp but from what I do know I would imagine what you want to do would involve the .htaccess file in the apk's directory
My guess would be in the .htaccess file you'd have to edit/add the FilesMatch line
(if that doesn't work it may me just "Files" instead of "FilesMatch" - not sure)
Code:
<FilesMatch "\.(apk)$">
ForceType application/octet-stream
Header set Content-Disposition attachment
</FilesMatch>
Other alternatives I can think of are either:
Change the link from [B]ftp[/B]://your.ftp.org/blah/android.apk to [B]http[/B]://your.ftp.org/blah/android.apk when you give it out - but I realize this kinda defeats the purpose of using a FTP in the first place
Upload the .apk into a zip. That should force the 'save as' dialog
Hopefully this does the trick for you
**I hope this post looks correct - adding the html myself I may have messed up somewhere along the line, if it you see /LIST] or anything like that I'll fix it when I have access to a computer **
Sent from my Android using Tapatalk
Click to expand...
Click to collapse
Geniuous! Worked like clockwork!
(I used the http://-link from the start, that's where it failed.. but the .htaccess content did it's job!)
1+Thanks! ^^

Categories

Resources