Related
Following on from another thread where people were asking about availability of apps to start a looping video recording app, I've started work on this, and have made some promising initial progress.
I'm having to do this with Mortscript since the only language I can code in is not suitable for writing phone/pc apps sadly, but so far it looks to be quite suitable.
If you're interested in this I'm afraid you'll have to be quite patient as I can't promise it will be complete by any date and I might even fail to complete it, but I'm posting up now because I believe that it's still useful at its current state.
Basically what the code does at the moment is as follows:
Tells you how much memory is spare on your SDcard
Asks you what you want the minimum remaining memory (in MB, ie when your remaining memory reaches a certain point the script stops recording)
Opens the camera in video mode
Begins recording
Once recording, the remaining memory is checked every 5 seconds
When the remaining memory dips below the amount you specified the recording stops, the camera turns off, and a message confirming remaining memory is displayed.
If you add the script to the appropriate start menu folder then you can add it as a home screen shortcut like any other app, so that just one touch will fire it up.
At present I have not started working on the actual looping functionality of the video, so it records until it reaches the memory limit you specify, or until you stop it manually, but I think this is still useful.
Now for the 'funny' important stuff:
Please understand this code comes with absolutely no promises/guarantees etc - if you choose to use it, you do so entirely at your own risk and I am not responsible for any outcome of doing so. I've run it several times and it has worked well for me, but there's no guarantee that it will behave the same for others.
I'm not going to be answering questions about the most basic stuff in relation to Mortscript. Please read up on the basics of what it is and what it does, and how you implement it before using this script. It's nothing personal, just that my free time is extremely limited so I can't afford to spend it answering potentially lazy questions.
Do as you wish with the script if you want to modify it and improve it, or just tailor it to your own needs. For instance, you may wish to do away with the question about minimum remaining memory and set a fixed amount so the recording begins from just one shortcut press. I've set it like that really for ease of testing but it may be handy for people who want to keep a certain amount of their card empty.
You may have to change minor bits of this script to make it work for you. Main example I can think of is depending on where the default location is for video recording files on YOUR phone (ie storage or card - it should be card for this script to work), and also the name of your card. On mine the card is called "Storage Card" - yours may be different and would therefore affect the script.
Other stuff I've not thought of yet but that people might whinge about.
In a nutshell though, I hope some of you find this useful, and at some point hopefully in the not too distant future this might be a bit more automated and do exactly as some of us wanted on the other threads about looping video.
If others want to use this as a base and finish the job I'm not going to be upset shall we say.
Script in post #2
Either download the zip file, unzip and place the script in an appropriate folder on your memory card, or copy this script code into a notepad file & save it, then change the files extension from .txt to .mscr & place it where it needs to live.
Script contents/zip download:
Code:
Free1 = FreeDiskSpace( "\Storage Card")
Freemb1 = Free1 / 1048576
Message((Freemb1& "MB left") , "Memory remaining:" )
Min = Input( "Remaining Memory Cutoff Limit(MB)?")
MinMem = Min * 1048576
set Mem, MinMem
Run( "\windows\camera.exe", "-v" )
WaitForActive "Camera",5000
mouseclick(240, 700)
set Delay, 5000
while wndActive "Camera"
sleep Delay
Free2 = FreeDiskSpace( "\Storage Card")
Freemb2 = Free2 / 1048576
if (Free2 le Mem)
# end recording & close camera
mouseclick(240, 700)
close "Camera"
Message((Freemb2& "MB left free") , "Memory Info:" )
#to do - delete the file just created
#to do - start recording again:
#mouseclick(240, 700)
endif
EndWhile
Reserved in case I need it for anything else....
This is interesting, will try after I read up on mortscript. One thing cought my eye, it seems with mortscript you are able to do software clicks on the screen (#to do - start
recording again:
#mouseclick(240, 700)
Would this mean we could have a way to asign a hardware key to take pictures in camera mode? I know this has nothing to do with your app, it just came to my mind after seeing your code. It would be nice to have a hardware key to take pictures with our HD2's.
Anyway I will be following your thread for updates on loop recording. Thanks for your work here.
Thanks for your comments mate.
I'm not sure about the hardware button in camera mode. It might be possible but I'm only a novice at Mortscript myself so I don't actually know. I would guess that if MS is capable of registering the activation of hardware buttons and distinguishing between them, then it should be possible but don't quote me!
A script to do that would I think have to effectively listen for the camera being activated, then once it is launched, listen for hardware key presses from a specified key which would in turn trigger the on screen mouseclick command.
Something for another thread I think but an interesting idea anyway. If you search through the mortscript examples thread (approx 70 pages!) you might find something that helps.
After a quick look at the manual this morning I think it's going to take me a little while to figure out how to delete the last created file in the DCIM folder, but once I have it sorted I will post up the amendments.
Run into a problem tonight with timestamps.
The time a file was recorded is showing up exactly 1 hour wrong from when it actually was made, so I have to try and figure this out. It's not the phone clock since the timestamp for the current time is spot on.
Go figure!
Thanks for posting updates for us. Hope you will find a solution, could it have something to do with summer/winter time? Or with local time? Don't know for sure of course, just trying to help.
I think there's a very good chance that's what it's linked to yes, but no idea how to get around it.
The dates where the clocks move forwards/back are not the same each year, so I can't hardcode it in. If there's a way I can get the script to check whether the phone's clock is using GMT or BST then that would likely solve it but I've no idea if that's possible.
Have raised a thread elsewhere to ask for help but no luck so far.
Well - I'm going to be struggling with this a bit guys.
I've not had any replies to the thread (http://forum.xda-developers.com/showthread.php?t=690134) asking about this time difference (I'm wondering if I have posted in the wrong subforum perhaps?) so I'm not really going to be able to get past the issue anytime soon. Kind of scuppers the project until I can work around that.
There is another way potentially of finding the correct file to delete, which would be to go through the mp4 files in the video folder, and create a list of them, sort it by time created, then delete the latest one.
But I don't know how to do that and there isn't any useful info that I can see in the Mortscript manual about sorting data, or even creating simple lists of data objects (unless this is the 'array' functionality?).
So I'm a little bit stuck sorry.
Has anyone had a look at touchstudio? You can program some codes using it that access a lot of the phone's stuff.
Any developer/hacker wanna take a look at it and maybe see what dll allows access and stuff?
I've seen it. But I've seen nothing that has access to something cool. What are you referring to?
I don't think that TouchStudio has more access to the whole system than other apps. Because anything that you program in the app gets just displayed on the "wall" (or whatever that thing is called )...
And if there are interesting parts in this app MS has locked down these parts for sure...
I just downloaded this as it looks interesting and I'm hoping to learn a bit more about coding. Has anyone used it much? Is there any way to actually effectively use the codes that you create? It doesn't appear like theres a way to export the actions to your homescreen or anything to make them useable, aside from going into the touchscreen app and then running it. Is this just because its the beta version, or is it really just supposed to be for fun/learning?
I've noticed since upgrading my Droid X to Gingerbread that many websites that were previously fooled by setting the User Agent (in Dolphin HD) to "desktop" are no longer fooled and can now detect that I'm on a mobile device. This can be quite irritating as the mobile version of many sites is horrible.
To see if this article pertains to you, if you're set for a desktop user agent string, go to http://www.bbc.co.uk and see if you get the mobile version of the page or the desktop version. If you get the mobile version despite your user agent setting, this hack may help you.
When this first happened to me I decided to find out how the sites were detecting the fact that I'm on a mobile device. Generally a website only knows what you tell it about yourself, and what you tell it about yourself is 100% in the HTTP headers your browser sends (or that get added by a proxy server if you use one). So the first logical place to look was to see what all headers the browser was sending. Note: for any who might object that it also knows things about you by your cookies, your cookies are actually sent as HTTP headers as well.
I have a CGI script on one of my web servers that I use to see what all headers my browser is passing. There are plenty such scripts/sites on the web -- here is a decent one (it's not mine) if you want to see what your browser sends. Examining the headers, one stuck out like a sore thumb:
Code:
HTTP_X_WAP_PROFILE='http://uaprof.vtext/com/mot/mb810/mb810.xml'
Geez, that's a pretty dead giveaway isn't it? I checked a phone running FroYo and it does not send that header, so that further confirms this is the header these sites use to detect me as a mobile (since they don't detect me as a mobile under FroYo and do under Gingerbread).
I then Googled HTTP_X_WAP_PROFILE and found numerous coding resources where they suggest looking to see if that header exists and/or is set to anything in order to detect mobile browsers. Bingo.
Great - so how to get rid of it? My first thought is that since the header is clearly identifying me as a Droid X (MB810), there has to be something in the phone that is providing the data. Since I observed that the header is present whether I access the net via WiFi or via 3G, that further confirmed that this is all happening in the phone and not being added by Verizon in transit.
The first sensible place to look was /system/build.prop. Turns out that the first sensible place to look was the right place to look as I found this line:
Code:
ro.mot.hw.uaprof='http://uaprof.vtext/com/mot/mb810/mb810.xml'
Well, that's about as perfect as you could ask for. Not knowing if the phone might be touchy about completely removing this setting, my first attempt was to change the line to read like this:
Code:
ro.mot.hw.uaprof=''
I found that you must reboot the phone for the setting to take effect (no real surprise there). Unfortunately, afterward, when I examined the headers being sent by the browser, they now contained this:
Code:
HTTP_X_WAP_PROFILE=''
With that setting, the various websites still detected me as a mobile browser (which you would expect). Next I tried changing the build.prop to this:
Code:
ro.mot.hw.uaprof=
* Note - there is nothing after the equal sign - not a space or anything, just a carrriage return.
This (pleasantly) resulted in the HTTP_X_WAP_PROFILE header being completely absent -- the ideal outcome. Happily, the various websites that were detecting me as a mobile no longer did. Success!
In the interest of being thorough, I tested just removing the ro.mot.hw.uaprof setting altogether (by commenting out the line). I figured that probably was not the best plan, but I wanted to see what would happen. When I did that, the following header was the result:
Code:
ro.mot.hw.uaprof='http://uaprof.motorola.com/phoneconfig/MotoMB200/profile/MotoMB200.rdf'
Interesting default value -- and of course I was again identifiable as a mobile device.
So, the fix for this is pretty simple. The exact property that needs to be modified in your build.prop would of course vary if you're not running a Motorola build, but I'd expect it to be readily identifiable. Of course you have to be rooted to do this, and of course you should make a backup copy of your build.prop before you modify it, and of course you should think about what your fallback recovery is going to be if you foul up your build.prop and end up in a boot loop or something. Can you boot into Recovery and then fix the file with ADB, etc. -- it all depends on how your phone is set up.
For those that like step-by-step, here's precisely what I did:
Open Root Explorer (or other "root aware" editor)
Navigate to /system
Mount system as R/W
Open build.prop in text editor
Find the ro.mot.hw.uaprof line
Put a # at the beginning of the existing line (to make it into a comment)
Insert a new line below the existing line that says "ro.mot.hw.uaprof=" (without the double quotes -- no characters after the equal sign)
Save and exit editor
Mount system as R/O
Reboot phone
By doing it this way I end up with a backup copy of the original string in case I want to easily put it back. Root explorer automatically saves the original build.prop as build.prop.bak, but if you're really cautious you might want to actually make a copy of the file to your SD card or something.
At this point, in Dolphin HD, with my user agent string set to Desktop, all of the web sites that had begun seeing me as a mobile device now serve the normal desktop page (as desired). If I want to see the mobile version (for some reason) I can just switch Dolphin HD back to Android mode (user agent string) and then I get the mobile version.
Hope this helps someone. Sorry it was so long -- almost everything I write up is.
P.S. If you do this successfully on a non-Motorola phone, post here and let others know.
firstly,, BIG THANKS
I am running a GB2.3.3build.596 P3D 2file root DroidX..
when i open ROOT EXPLORER in r/w mount and open the build.prop i can not type anything..and this mobile site only crap was the reason i took 2 days of forum reading at 3 forums before i went ahead and sbf'd back to froyo from a stock Verz 2.3.3GB to then root ,and then to install the 2 P3D files to have a .596 build GB rooted phone
any suggestions, maybe another editor ware? total newb
Trying to see if this is possable....
What I would like to do, is make my WP7 device see my Data Connection as a Wi-Fi connection to download larger apps from the Marketplace when I am away from home or away from a wi-fi connection. Something that could be turned on and off.
Is this even possable ?
I hate the fact because I am on the road I can't buy a new App because of it's size, even tho I am on a full 5 bar 3G connection.....
Thoughts ?
My guess is that there is a throttling bit set in the registry for the Zune app for when not on wifi - I just can't seem to find it.
There's a value which appears to control this limit specified a file in \My Documents\Zune\PimentoCache\Keepers. The files there are downloaded to the phone based on your carrier and OEM, but they can be temporarily replaced (this is how my OEM Marketplace XAPs work).
GoodDayToDie said:
There's a value which appears to control this limit specified a file in \My Documents\Zune\PimentoCache\Keepers. The files there are downloaded to the phone based on your carrier and OEM, but they can be temporarily replaced (this is how my OEM Marketplace XAPs work).
Click to expand...
Click to collapse
Are you saying that what I am looking for IS possable ?
If so where do I get started with this ?
I'd love something that could go in the Settings menu to enable a 50mb limit or something, that I can turn off when I am done.
You'll need to interop unlock and/or root your phone so you can browse/edit the registry.
Moved TO WP7 Q&A
Thread moved to WP7 Q&A. Please post in the correct section in the future. Posting in the dev section just to try to get extra exposure is not allowed.
GoodDayToDie said:
There's a value which appears to control this limit specified a file in \My Documents\Zune\PimentoCache\Keepers. The files there are downloaded to the phone based on your carrier and OEM, but they can be temporarily replaced (this is how my OEM Marketplace XAPs work).
Click to expand...
Click to collapse
Now that this thread is back open.. I would like to see if it's possable to get to the bottom of this.
What my dream is here... A little app that is in the Settings that will allow you to change your settings to allow the limit to extend to 50-100mb for a short time. This will allow users to download a larger App from the marketplace.
One of my biggest hates on WP7 is when I am on the road (not at home or by a wi-fi network), I can not BUY a new app because of it's size limits.
Has anyone tried this ? And do you need root access on your device for an app to be able to change this setting (by just flipping a switch) ?
Thanks !
Check this thread for more details that might be useful.
http://forum.xda-developers.com/showthread.php?t=1602691&highlight=download+limit
DavidinCT said:
Now that this thread is back open.. I would like to see if it's possable to get to the bottom of this.
What my dream is here... A little app that is in the Settings that will allow you to change your settings to allow the limit to extend to 50-100mb for a short time. This will allow users to download a larger App from the marketplace.
One of my biggest hates on WP7 is when I am on the road (not at home or by a wi-fi network), I can not BUY a new app because of it's size limits.
Has anyone tried this ? And do you need root access on your device for an app to be able to change this setting (by just flipping a switch) ?
Thanks !
Click to expand...
Click to collapse
I had the same issue and the solution to it is to edit the xml files LKG_MOConfig.xml and Downloaded_MOConfig.xml located at /My Documents/Zune/PimentoCache/Keepers. The download limit is set to 20 and can be edited to a higher value. I recently downloaded an 80 MB file through my 3G network. The only downside it seems is the files get replaced by the OS in every few days. To get round that I have made the files read-only and testing it. Will let you know how it goes.
And yes it will require a rooted or a fully unlocked phone.
Thanks to ken52787 for figuring out the files and his thread http://forum.xda-developers.com/showthread.php?t=1602691
You don't need full unlock, just interop_unlock with a file browser.
Testing myself...
drkfngthdragnlrd said:
Here's the pre-edited files with a 200 MB limit & the "Read Only" attribute set in case it works. You don't need full unlock, just interop_unlock with a file browser.
Testing myself...
Click to expand...
Click to collapse
I'd remove these files. These are only valid for T-Mobile and my guess is it'll cause some problems if someone tries to buy apps with them on another network.
If someone can't figure out how to edit the xml themselves and change a single number, they probably shouldn't be messing with this to begin with.
Can these be put in a XAP ?
ken52787 said:
I'd remove these files. These are only valid for T-Mobile and my guess is it'll cause some problems if someone tries to buy apps with them on another network.
If someone can't figure out how to edit the xml themselves and change a single number, they probably shouldn't be messing with this to begin with.
Click to expand...
Click to collapse
Good point, had a brain fart & didn;'t think these files might be courier dependent, files removed...
Actually, I'd really appreciate it if multiple people (different carriers in particular, I already have the OEMs) posted their PimentoCache XML files. I'm working on an app that will allow people to easily switch their Marketplace settings (OEM, MO, max download size, etc.).
GDTD - Let me get these files off my Verizon Trophy and I will post so you can add to your xap. I'm off for work so it may not be until later today.
Here are the VZW files. I already edited them for 200MB download limit.
View attachment 1016305
Hi all.
I'm after quite specific need but would like to know more general answer / solution if possible at all.
I know that wihtout being rooted there's not much one can do with system folders, but still, there are some ways and tricks to get to them, one of them being Backup option provided by android, using ADB shell.
I'm after specific file, that is /data/data/com.android.mms/shared_prefs/com.android.mms.categoryInfo.xml
Using Htc One M8, stock rom, I've tried to do adb backup of com.android.mms application, but all I got was 1kb (actually 41 bytes) sized file, which contains nothing.
I wonder, is there any other way to get to the specific system app folder, if you're NOT rooted?
Any help would be highly appreciated.
Additional info: I'm after that file because it has stored Secure message box password in Plain text. My phone is about to go to the service due to several issues, including battery getting way overheated when used, and not charging over 25% at all, and the only thing left to make a backup is the secure box storage, which I used as an "Other inbox" folder in order to have the main Inbox a bit more "clean", and I know I've set it to something stupid and short, and I've accessed them not long ago, but for the f's sake I can't get in the folder anymore (and I'm highly betting that after several attempts even the real password is no longer accepted, and that being the reason I can't figure out the pass by trying, but there's nowhere info it thats true, and if so, how long to wait before real one would be accepted etc...)
Big thanks if anyone could help out, if not - not gonna be the end of the world. But would kinda like to store some of the messages that are newer than my latest backup...
Cheers!
cucolino said:
Hi all.
I'm after quite specific need but would like to know more general answer / solution if possible at all.
I know that wihtout being rooted there's not much one can do with system folders, but still, there are some ways and tricks to get to them, one of them being Backup option provided by android, using ADB shell.
I'm after specific file, that is /data/data/com.android.mms/shared_prefs/com.android.mms.categoryInfo.xml
Using Htc One M8, stock rom, I've tried to do adb backup of com.android.mms application, but all I got was 1kb (actually 41 bytes) sized file, which contains nothing.
I wonder, is there any other way to get to the specific system app folder, if you're NOT rooted?
Any help would be highly appreciated.
Additional info: I'm after that file because it has stored Secure message box password in Plain text. My phone is about to go to the service due to several issues, including battery getting way overheated when used, and not charging over 25% at all, and the only thing left to make a backup is the secure box storage, which I used as an "Other inbox" folder in order to have the main Inbox a bit more "clean", and I know I've set it to something stupid and short, and I've accessed them not long ago, but for the f's sake I can't get in the folder anymore (and I'm highly betting that after several attempts even the real password is no longer accepted, and that being the reason I can't figure out the pass by trying, but there's nowhere info it thats true, and if so, how long to wait before real one would be accepted etc...)
Big thanks if anyone could help out, if not - not gonna be the end of the world. But would kinda like to store some of the messages that are newer than my latest backup...
Cheers!
Click to expand...
Click to collapse
Yes and not.
if you don't have root access, you can not copy an application from the system folder, to make this the ADB would need root permissions. but....
You can download the stock rom, and copy/extract/edit the app you need it.
xdedeone said:
Yes and not.
if you don't have root access, you can not copy an application from the system folder, to make this the ADB would need root permissions. but....
You can download the stock rom, and copy/extract/edit the app you need it.
Click to expand...
Click to collapse
Actually no, if the file is user specific, as in my case, the help of stock rom's file is not gonna help.
Anyway, SOLVED now.
As per this post: http://forum.xda-developers.com/showthread.php?t=2054401
The backup of the app was made and got the file. I've done the same thing without success, because on HTC, the messaging app is com.htc.sense.mms and NOT com.android.mms.
Therefore creating backup of the com.htc.sense.mms did result kin getting exactly what I needed.
In the extraction of the tar .ab archive using dd in linux, I got folder app, within there is a folder com.htc.sense.mms, wihtin there's a folder sp, and there is com.htc.sense.mms.categoryInfo.xml which has the secure box password stored in plaintext.
Voila! )