[Q] Here's a quesiton on WP7.5 dev using SQL CE.... - General Questions and Answers

Alright so here's the deal:
I'm working on this app (let my raise my "nerd" level to a new maximum, by stressing that it is a Magic: The Gathering app for the WP7. Nerd level raised.)
So - at any rate - I start out with a wonderously fluid Silverlight front-end. Works like a charm. Keeping it simple at first, I get the ball rolling with a simple life counter function, using local variables only. Flawless. Then I figure I'll raise the bar of challenge a little, and import a simple dbusing SQL CE loaded from Wizards of the Coast official online card database. My app has a "fairly" quick search engine that goes through the entire set of cards and displays a list of the cards with text. Again, pretty damn flawless. Now here's the pickle. Because my SQL CE DB of the cards is pre-built into the app, it is, by default and no way to change it: read-only. I want to load and create a new DB on the fly, by reading a simple .txt file, and parsing out prices. Ideally, this DB would be created once, and everytime afterwards, simply updated. Now I can read and modify the Database easily, however, when i try to read the .txt file from the online source, it fails with epic certainty. Even more bothersome, I can't get the bloody thing to run efficiently in the background.
So to the question at hand: Does anyone know of a quality way to read a .txt file from an online source, parse successfully into a database, and do so as a background task?
Thanks

Could you elaborate on how exactly does it fail? Also, by "on background", do you mean that you are trying to update the database on a background agent (which I would not suggest in your case) ?
edit: Looks like it's a bit old thread. Are you still having this issue?

Well, by fail - I mean it either doesn't update the database at all - or it crashes and the program terminates.
And why would a background agent not be recommended? I like the idea of BG agent simply because i'm assuming the average user is going to be impatient and close out the app before the db actually updates the prices...at which point, it would be ideal if this were running as a background agent because otherwise i've discovered that just stopping DB search/edit halfway through sometimes hangs or crashes when you try to get back into the db.
Ideally, i'd like this thing to be pretty glitch free. I suppose i could do like every other app out there and only grab a price when a single card is selected, but ideally i would like the entire price database to be accessible in an "offline" mode. Its only a single text file updated weekly.

I see you're point on using a BG agent, but are you familiar with the limitations? You probably don't want to limit the sync to the moments when the phone is plugged into a power source, so periodic task would be your only choise. However, those are memory, cpu and clock time (25 seconds) constrained, run approximately every half an hour (can not be changed) and you can't start them instantly. Also, they need to be rescheduled every two weeks and there's a limit of how many BG agents can be scheduled for a device on total (can be as low as 6). So, you can only schedule the BG agent in your app, you can't start it immediately, if the completely sync process takes more than 25 seconds the agent would get killed and if the text file is somewhat huge you could run into the memory constraints of the agent.
I don't think there's anything you can do to make the sync succeed if user choses to close or suspend the app while it's syncing. I thought of an another option though: maybe you could just load the data for a card when it's drawn and store it to the database together with the last update time. Then in future you could first check if the database has up to date info on the card and use that instead of loading it from the web. Or maybe you could load the data for all the cards in the decks when the game starts.

Yeah. my solution for the time being is to see if there is an updated pricing text file online, and updating the silverlight accordingly (ie a "New prices available" button that appears if there are new prices) and a big ass warning box that warns users to not exit the app during an update.
however, i'm still having issues with parsing the bloody the txt file in-code. its a pipe-dil txt file so, it shouldn't be this complex to parse into a new table. i'll post up what some of the code looks like tonight for my parsing engine.

Sure, post ahead and I'll see if I can help you with that.

Related

G1 Startup Manager

Running Applications
Hi, im considerably new to the whole android development i have a g1 since early december and have upgrade it to the modded JFC 1.31 ADP. I also have the adp spl i think thats what u call it .
My question relates to the running processes/tasks/programs. I am concerned about the amount of programs that run in the background. Is there a way to cut down on this?
I have already removed Calendar, Amazon, Calculator, Calendar Provider seeing as how i do not intend on using these as for calculator i have installed a scientific calculator.
Its more or less Facebook, Craigslist, Imeem. The other bckg progs Gmail, Messaging, Alarm Clock are all smth i use so therefore i have no issue on that but ive tried editing settings on Craigslist, Facebook, Imeem and others to change the update interval and have maxed those out but still tend to run in the background i use the programs but i dont need them to update themselves.
Edit: I have also stopped the auto sync on Calendar, Gmail, Contacts Seeing as for Calendar i dont need it, Gmail i check it often, Contacts i dont use on my gmail service.
Have you got the task manager app from the app store? Thats what I do, and kill all the apps I don't need active.
TimSykes said:
Have you got the task manager app from the app store? Thats what I do, and kill all the apps I don't need active.
Click to expand...
Click to collapse
Yes i have, however they keep coming back up!
yeah I know some of them do. to me I don't know why alarm does. I don't even have a alarm set on my phone.
They come back due to the way android handles and saves tasks. The OS will keep resurrecting them thinking they are just dormant and were axed by them.
ArronL said:
They come back due to the way android handles and saves tasks. The OS will keep resurrecting them thinking they are just dormant and were axed by them.
Click to expand...
Click to collapse
So is there a way around this or not?
yeah.. im having the same problem, i shut them all down via task manager, but after like 1 minute i go back in there and they all come back up, is there any way to make them be off permanentally till you use them again?
tbh, the way the android works, if it keeps bringing these programs back they're probably not eating up too much memory.
in fact, no matter how much crap is running in the background i've never experienced any lag or anything. makes me wonder if there's any point in killing apps, except for ones that may be constantly connected to the internet.
Meltus said:
tbh, the way the android works, if it keeps bringing these programs back they're probably not eating up too much memory.
in fact, no matter how much crap is running in the background i've never experienced any lag or anything. makes me wonder if there's any point in killing apps, except for ones that may be constantly connected to the internet.
Click to expand...
Click to collapse
Well i definitely notice a lag, although i agree with you on the applications i removed like 80% of them now just using ones i need and just installed the 1.41 everything works great. But run about 10apps let them run in the bckgs and slide the main application tab on the home screen up and down and scroll through the programs. Then kill about all apps but 3 to account for ones you need and try it again you should most likely notice a difference.
Not on lag but background processes use up battery to, I did a wipe and have like four apps on my phone: aim astro any cut and ak notepad (wow must like A's) but my battery life is noticible better than before, I can go a whole day with out having to charge vs having to charge every few hours
does anyone know of a startup manager for the G1 for EG when i reboot or start up my phone i get a lot of services and programs which i use but do not want to start on boot.
i can use task manager to close them once the phone is started but wouldt be happy for something that disables these from the start.
Has anyone found a way to modify what OEM apps boot at startup?
So using Task Manager for Root Users we get this peek into what's ?running? on our phone. or am i sadly confused..
upon initial boot and after letting the phone boot fully (about 3 minutes) i get this list in my taskmanager..
Task Manager ---not oem
Service Viewer ---not oem
MyFaves storage
Messaging
Voice Dialer
Google Talk
Maps
Calendar
Alarm Clock
Power Manager ---not oem
Missed Call ---not oem
Messaging
Phone Recorder ---not oem
MyFaves Storage
Voice Dialer
Google Talk
Maps
The list remains the same even after several refreshes..
...oddly only after killing a few tasks this is added?
Gmail
note: at this point in service viewer/tasks, only taskmanager, launcher and service viewer are present..
After killing every process through multiple refreshes messaging (which I assume is a critical app tied to the notification bar) is the only thing that remains until i load something else..
First question..are the apps listed in task manager actual hurting my battery/memory/cpu performance?
Secone question..Is there any way to auto-kill these tasks upon boot, other than by removing them? Or is there some boot.ini type file that could be editted?
sry for the long post, just curious if something can be done...
Yeah id also like to know how to manipulate what starts up on boot.
Any dev should be able to tell us.
Plenty of apps start at boot.
Seriously I would LOVE the answer to these questions. Thanks
Now while this isn't coming from a dev, when I look at the running app list I often see things I haven't touched, but they won't start unless the phone's been idle. I think what happens is it actively fills empty ram with programs so they will start faster, so I think it's just in the nature of Android.
Fushichou said:
Now while this isn't coming from a dev, when I look at the running app list I often see things I haven't touched, but they won't start unless the phone's been idle. I think what happens is it actively fills empty ram with programs so they will start faster, so I think it's just in the nature of Android.
Click to expand...
Click to collapse
yes but dont they use up cpu/memory/battery? plus i dont think the programs are so resource heavy that they would need a process running.
An answer from a Dev is what we need
I think what we need is an explaination as HOW a program can autostart on boot. If every program on my phone (stored to sd) started automatically when I turned on my phone I'll be waiting a week for it to start up. There has to be a script that these programs add to or something to run these program automatically. Either that or it's the programs themselves that are set up to start up by themselves. Where if that's the case I think we're screwed.
I'm also VERY interested in this.
Also, how to keep apps from auto-restarting once you kill them. PixelPipe has a background service that, once you start the app after reboot, it won't die. Their app support guy states otherwise tho, heh.
Also, I like how the OS says a program has "died"
I wouldn't really worry about it. For one most of those processes will be sleeping. They use no CPU time when they're in this state. Some processes register an event with the kernel and just sleep forever until that event occurs and the kernel reactivates the process. Some processes sleep for a specific amount of time, wake up and do some task, then go back to sleep. In both cases the number of CPU cycles being used are likely negligible. Most of those start-up programs will fall into one or the other category. The stuff that does take up a fair amount of CPU cycles are things like the multimedia system, the UI system, messenging, etc. In other words, the stuff you want to keep running.
Also, I wouldn't pay too much attention to those memory usage numbers. There's heavy use of shared libraries in the system. Ordinarily processes are only allowed to access memory that is allocated to them. This memory is where the process stores the bits that make up its code (stuff that doesn't change) and where it stores its working data (stuff that does change). Its actually more complicated than that but this will suffice for now. Libraries that are not shared are accessible only to the process that is using it and is stored in the memory allocated to it. Libraries that are shared can be used by multiple processes. These shared libraries are allocated to one place in RAM and when an app needs to use one of them the kernel takes care of mapping the location of the library so the app can access it as if it was in its own memory space.
The memory usage numbers you are seeing do not take into account these shared libraries. An app may be using only 1 or 2 MB of RAM but since it uses a shared library the RAM being used to hold the library is also counted and the size could be shown as 20 or 30 MB higher that what it actually is. You could kill a process and recover some memory but its probably not enough to be worth it since more than likely most of the RAM being used was in shared libraries and they'll still be there after the process is gone.
numerik, thanks for the info. But now I guess my bigger concern would have to do with this part:
Some processes sleep for a specific amount of time, wake up and do some task, then go back to sleep.
Click to expand...
Click to collapse
Similar to the problems we run into in windows. Some lame program gets added to msconfig (be it a m$ app or wicked virus), it sits there idle when you fire up your computer uses a minimal amount of cpu amd memory then does who knows what whenever it wants.

Android Fork Bomb

Just out of curiosity does anyone know if any android devices can be affected by a fork bomb sent via text or email?
It is Linux so I'm guessing it will be affected. Maybe it won't be like OMG but it will be some what affected.
If a text or email could execute a custom script on being received, there is probably a lot worse that it could do than a fork bomb... Might be possible to get two views to keep calling each other, in which case the bundle for that program will expand until it runs out of memory and android will kill the app. This is very much an app specific bug though, and isn't related to the "fork bomb" of a program making a new instance of itself.
I thought Android runs on the sandbox environment for applications, which means the app can't execute much permissions as compared to Windows.
Just my $0.02
Yes, the apps are sandboxed for the most part.
Now that I think on it, there is a launch flag to open a new instance of a program leaving any currently running ones alone, which could be used to make a forkbomb. In this case, it would not be stopped by memory as the earlier instances will shut down but the exponentially increasing new instances will keep going, probably making the phone unusable until a reboot.
This can only be done by compiling and launching a signed app though, no email client can do this unless it has a backdoor to trigger this code from itself or from a trojan-esque feature to download, install, and launch apps on its own. The user would be promted to ok the new app's permissions anyway, unless it uses and gets permission for root access.
Basically, forkbombs are possible, but not by email or text with stock or nonmalacious programs.
Task Management
If the script gained root access, it'd be just the same as on a Linux machine. But I believe the DalvikVM simply kills any apps/processes it needs to in order to keep the system running smoothly (in theory).
well it works...
https://github.com/nicandris/com.example.forkbomb

[Mortscript 'App'] One Touch (ish) Video Recording

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.

Web Browser With Black Background (Invert Colors / Night Mode) Through Proxy Filter

This is a solution for people looking to invert colors or force specific colors (e.g. white text / black background) on their web browser. Great for easier reading (especially at night) and saving power on OLED screens. CyanogenMod's browser has an invert colors option built in, but as far as I can tell, nobody has been able to port the CM browser to other ROMs. This solution works with any browser or ROM.
The basic idea is to run a web filter proxy such as Privoxy. Proxy filters are usually used for ad blocking, but they also have the power to completely rewrite a webpage. Privoxy is run in the background, and using the browser or WiFi/APN proxy settings, all web traffic is run through Privoxy. Privoxy rewrites the web pages based on the filters before it is displayed on your browser.
In the attached set, I've put together some badly-written but effective filters to force light text on black backgrounds. The filters rewrite the webpage so that the background is always black, text is always light gray, and links are always green. The filters only tweak the HTML/styles, so as a (usually) helpful side effect, the pictures remain unchanged. With my current configuration, Privoxy loads automatically in the background at startup, and all web pages run through Privoxy and are displayed in my designated colors. See the screenshots below to see it in action.
I put together a simple set of files that so folks can test this out.
Requirements
- You must have a rooted phone.
- You must be able to access proxy settings. Depending on your firmware, you might be able to set a proxy in Wireless and Network Settings (Wi-Fi settings -> Advanced, or Mobile Networks -> Access Point Names). You can also try an app like Transproxy or AutoProxy, or a browser that supports proxy settings, such as Firefox Mobile with the Proxy Mobile add-on.
Instructions
- Download and install Autostart (Root) from the Market.
- In your root folder, create a folder called /data/opt
- Download the attached "force_colors.zip" and extract the files
- Place all the files in /data/opt. Set appropriate permissions. (Privoxy and autostart.sh need to be executable.)
- Reboot your phone. Autostart should run the autostart.sh script (it will ask for superuser permission) and Privoxy will run in the background.
- Set your proxy host to localhost and the proxy port to 8118.
- If everything went correctly, all webpages should load in black background, light gray text and green links.
Note: If you use DroidWall or similar firewall settings, make sure that you allow access for "Applications running as root" so that Privoxy can access the network.
---
Note that these filters are infinitely customizable, if you know how to use regular expressions. Just edit force_colors.filter with the filters of your choice. For example, the Privoxy filters available here are specifically designed to invert some colors and make other ones darker, so you can still preserve some website colors in a more readable format.
In the next post, I'll describe everything I researched in pursuit of this solution. I am hoping others will pick up this project and make it into an easy-to-use package, and also to create some alternative filters to make them cleaner and/or more effective.
I think this feature is sorely needed in Android. Please pass the word to any developers who can help make it a reality!
[Note: This is my earlier post explaining what I did to make this solution work. Please note that I am a complete development noob! I hope this information is helpful and other people will improve on my solution.]
- There is an Android port of Privoxy on the Android Market called Privoxy (BETA 1). Install it and see if it works for you. On my phone, the app interface does not work. If I try to manually start Privoxy in a terminal window, it gives me a seg fault. Anyway, run the app once regardless, so that it copies the Privoxy files to the app data directory (/data/data/com.galoula.Privoxy/). We will use this directory as our base.
- A *working* Android port of Privoxy is included in Orbot: Tor on Android. (Tor uses Privoxy to pass the HTTP requests to a SOCKS proxy.) Download, install and run Orbot. You just need to run it once so that it copies the Privoxy binary to the app data folder.
- You'll find Orbot's Privoxy binary in /data/data/org.torproject.android/app_bin. Copy the "privoxy" binary and use it to replace the binary that came with Privoxy (BETA 1) (located in /data/data/com.galoula.Privoxy/bin). Set appropriate permissions. (We only installed Orbot for the binary, so you can uninstall Orbot now if you don't want it always loading in the background.)
- Now set up the filters. Download the attached force_colors.zip below. Extract the three files (force_colors.action, force_colors.filter, and privoxy_conf). Copy these files to /data/data/com.galoula.Privoxy/etc.
- Open a terminal window, navigate to /data/data/com.galoula.Privoxy/bin and start privoxy by running "./privoxy ../etc/privoxy_conf"
- By default, Privoxy will listen on port 8118. Go to your WiFi settings or APN settings. Set the Proxy name to "localhost" and the port to "8118". Now all web data will pass through Privoxy.
- Browse to a few websites and you'll see white text on black backgrounds! The default colors in the force_colors.filter are black for backgrounds, light gray for text, and green for links. Feel free to edit force_colors.filter to whatever color combination you prefer. I used HTML color names instead of hex codes to make it more readable.
- To run Privoxy every time at startup, I use an app from the Market called Autostart (Root). The directions are limited but basically, you just need to install the app and make a file called /data/opt/autostart.sh (set appropriate permissions). Then in autostart.sh, put this line: "/data/data/com.galoula.Privoxy/bin/privoxy /data/data/com.galoula.Privoxy/etc/privoxy_conf". The next time you reboot (might have to try it one or two times), Autostart will ask for superuser permission, and start Privoxy automatically.
Hope this is helpful for anybody else who wants to experiment.
hey claimui, this looks like a great approach! i'm looking forward to giving it a try this weekend and learning more about how the filtering works!
I spent a couple of days learning regular expressions (or at least some of them) and throwing together a simpler set of filters to force certain colors on a webpage. With this set, all backgrounds are black, all text is light grey, and links are green.
EDIT: My filters are now included in the force_colors.zip attached in the OP.
added to
black energy saving android apps for AMOLED screens
I made several updates to the original posts, including a suggestion on how to get Privoxy to start automatically on boot. After going through this whole process, this is a really effective solution. Privoxy starts automatically and invisibly whenever I start up my phone, and all of my webpages automatically pass through Privoxy and get displayed in my preferred colors.
For future tweaking, it would be nice to have a simple shortcut to enable/disable the filtering. (Although honestly I never want to disable it -- I always like my colors better!) Note that you can't simply kill Privoxy because your browser won't be able to find the proxy to connect to. So you either need a Privoxy command to toggle filtering on and off, or toggle the proxy settings to either use or bypass Privoxy.
In the meantime though, I think this still works really well. Hope others give it a try and can improve on the procedure.
Major update: I have finally consolidated all the steps into a small zip file and some simple instructions. You will need root access and a file manager or some basic knowledge of how to get around your phone. Just follow the instructions in the first post and you should be able to get it working very quickly.
Would like to test this but couldn't things to work...
Privoxy now updates to beta2.
Everything I try I get 404 Page can't loaded...
Have changed to localhost and port 8118 but doesn't work...
No need to install Privoxy from the Market. Just follow the instructions in my first post. After you install the Autostart app and put the files in the /data/opt folder, Privoxy will start at the next reboot.
Thx! Think it was a problem with SiyahKernel! After flashing from 2.0b2 to 2.0b3 now privoxy work!
Thx a lot! Have long time searched for something similar!
when I try to create the folder /data/opt it says it is created but in doesn't show up. also when I create the same folder and then move it to root folder it automatically renames it opt. I'm using root explorer.
In Root Explorer, first navigate to the /data folder, then click the button to Mount as R/W, then create the opt folder. Does that work?
Updated the OP to include some more suggestions for folks who are having trouble finding proxy settings. The basic options are:
1. See if your firmware comes with proxy settings. Under Wireless and Network Settings, look in Wi-Fi settings -> (menu button) Advanced, or Mobile Networks -> Access Point Names.
2. You can also try an app like Transproxy or AutoProxy.
3. Try a browser that supports proxy settings, such as Firefox Mobile with the Proxy Mobile add-on.
Nice.
Have you by any chance conducted a battery test or otherwise made any effort to notice the impact of this modification on battery life?
I haven't personally done any battery experiments (at least not for the browser) but this is a good reference: http://forum.xda-developers.com/showthread.php?t=660853
Basically yes, black backgrounds do save battery power on AMOLED screens. Personally I think the difference between 5% and 3% (or 3% and 2% at lower brightness) is not that big of a deal, probably not even noticeable in normal use. But if you want to squeeze the most milliwatts out of your battery then this will help.
To me the main benefit is that black backgrounds are just much easier to read, especially at night, and especially with the deep blacks / high contrast of the AMOLED screen.
Don't need 10 chars for this replay.
AWESOME!
Edit:
Sadly, from the time that passed since I posted this post, I stumbled upon a few annoying bugs.
1. Proccess locked at 50% cpu, (100% of a single core)
2. Some sites just don't work, and then I have to restart the browser.
Yes google mobile site everytime I would like to search something I get this Error:
This page contains the following errors:
error on line 3 at colum 31: AttValue: " or ' expected
Reparse document as HTML
I know regexp pretty well, but Privoxy syntax is a little bit confusing.
I'm trying to figure out the filters supplied by the OP, and they are just too confusing
To OP : How do you set the delimiter for the filters in Privoxy?
I know / and | are possible, are you using + for some reason?
All your filters start with s+, what is the + ?
Great work. Autostart didn't work on my Galaxy Note for some reason.
But maybe changing CSS is easier. This method works on Opera Mobile:
http://forum.xda-developers.com/showthread.php?t=1326434
eitama said:
Sadly, from the time that passed since I posted this post, I stumbled upon a few annoying bugs.
1. Proccess locked at 50% cpu, (100% of a single core)
2. Some sites just don't work, and then I have to restart the browser.
Click to expand...
Click to collapse
Hm, I haven't encountered these bugs. I am using the same files that I uploaded in the zip. Does it only happen with certain sites? Maybe I just need to tweak the filters. My regexp is poor so they are very crude, and could easily screw up some sites.
bgx said:
Yes google mobile site everytime I would like to search something I get this Error:
This page contains the following errors:
error on line 3 at colum 31: AttValue: " or ' expected
Reparse document as HTML
Click to expand...
Click to collapse
Can you tell me the specific URL? I notice you're on T-Mobile so maybe you have a carrier-specific browser/search settings.
eitama said:
I know regexp pretty well, but Privoxy syntax is a little bit confusing.
I'm trying to figure out the filters supplied by the OP, and they are just too confusing
To OP : How do you set the delimiter for the filters in Privoxy?
I know / and | are possible, are you using + for some reason?
All your filters start with s+, what is the + ?
Click to expand...
Click to collapse
Privoxy syntax is supposed to be like Perl -- well I don't know Perl so I'm just copying what I read. The basic reference is here: http://www.privoxy.org/user-manual/filter-file.html
In my filters, I'm using + as the delimiter. In Privoxy you can use whatever delimiter you want, and it doesn't make a difference (I think). I just copied the + from another filter set -- probably because it's easier to read than / when working with HTML.
The first couple of filters should not be too hard to figure out. For example:
Code:
# Set default colors
s+<body+<body bgcolor=black text=LightGray link=LimeGreen vlink=Green+isUg
This just makes sure every <body> tag starts with "<body bgcolor=black text=LightGray link=LimeGreen vlink=Green" (very crude, I know). The isUg at the end are the modifiers:
i = case insensitive matching
s = allow string to span multiple lines
U = ungreedy matching
g = global matching
Two filters substitute a tag with "JED-C-Anchor-color". This is not a valid tag; the browser will just skip it so the effect is basically the same as deleting the tag. Substituting instead of deleting just makes debugging easier. I used "JED-C" because I modified these filters from http://members.cox.net/pu61ic.1inux.dunc4n/software/privoxy.jed
tamarian said:
But maybe changing CSS is easier. This method works on Opera Mobile:
http://forum.xda-developers.com/showthread.php?t=1326434
Click to expand...
Click to collapse
Thanks for the tip! Yeah I know about changing CSS and that would be a better solution. But I don't think there is a way to change the CSS with the stock browser, and some people still like using the stock Samsung browser for hardware acceleration or whatever other reason. But maybe somebody could make a Privoxy filter that adds the same CSS code into all webpages?

(Use case within) Most suitable no-root packet capture app? Or should I get back into development again?

TLDR: Got new phone, don't want to root now but still want to do things I needed root for. I need a non-root packet capture solution, or to decide if I should still root my new phone, or to get into development again. What is my best option? Use case below.
I have always rooted my phones which have always been as easy as 'fastboot oem unlock'. Not with ROG3. It needs an OEM tool and from what I read here I only get one chance.
After all the years though my uses of root fall into one of 3 categories: ad blocking, back up, and one specific case of packet capture.
I used AdAway for DNS level ad blocking. Private DNS with dns.adguard.com seems to be fine for that. Easy enough to set up.
Backup is with Titanium Backup. I am going to install all apps I ever had on my last phone (which has root and Ti) hoping that the stock transfer tool would pick them up and carry them over. Storage is not an issue; I have 512G. Apps I really don't care about anymore can be deleted later.
Next, my sticking point: Packet capture.
For that I have been running a tcpdump binary inside Terminal Emulator a week at a time. I am after the network traffic of one game, which I am not going to name for fear of ruining the fun. Its traffic has been in clear HTTP since I started playing in 2015. Through it I have gathered how units level up, enemy patterns in battles, and scripts for story scenes. I so enjoyed having these data that I kept playing, as long as it remains viable. My setup writes a pcap file to external storage that I can copy to my laptop for analysis. I configured tcpdump to capture only traffic to/from one IP to save space.
To get the same functionality I need a packet capture app to capture only the game's traffic, and save one pcap file per session. I tried 3 such apps and they all fall short in one way or another.
TPacketCapture captures all; app filter is its very expensive paid feature. Plus it stalls all traffic within 3 minutes of starting.
Greyshirts SSL Packet Capture splits capture by HTTP streams. Each must be selected manually for export with no option for a whole session export. Is a problem because every transaction of the game is its own HTTP stream. Is also a known beef among users and author seems unwilling to address. It keeps its data files to itself; I was only able to get them via root and they are not straight pcap, yet not difficult to figure out. It does decode the game traffic very nicely, to the point it becomes human-readable.
PCAPDroid does not save files; it only streams off its builtin HTTP server or UDP. I could not get useful capture out of it, but it is open source, so I could try adding that feature myself, hence the question of getting into development.
I did find a way to mass export data out of Greyshirts. I can use adb backup to back up that entire app's data. Then I found information on how to extract from it the data files it kept to itself. Then because those data is in a lighter format than pcap, it's actually easier for me to script a parser and work on them directly!
-- EDIT --
I found that some public wifi break if used with a private DNS.
Then for some time I totally lost adb backup functionality! I would get an empty backup even though everything else goes as expected. I resigned to defer moving that game over and set up Android Studio to start that development work I mentioned (in essence, attempt to modify PCAPDroid to save captures to external storage and add AdAway functionality).
Instead of using just the command line tools like I always have, I installed Android Studio. The SDK tools got updated along the way to 1.0.41 on SDK Tools 30.0.5 (I got the "ADB backup deprecated" message too, but the [email protected]% I care) . Then when I tried adb backup again I got my full backups again.
-- END EDIT --
I think there's my solution and I can now go without rooting. If I do need root in the future, adb backup should save the day.

Categories

Resources