Showing posts with label sqlite3. Show all posts
Showing posts with label sqlite3. Show all posts

Sunday, June 4, 2017

Customizing / Changing Android DPI settings

There are multiple ways in which the Android DPI Settings and other window manager settings can be changed.One common method is to use the wm helper, for example:
wm density 160

Another common method is to modify dpi settings using the prop file (/system/build.prop). This is mostly done by adding/modifying the following line
ro.sf.lcd_density=160

in the build.prop file by editing it via fastboot, root, or helper apps.

Both these have limitations, the first method may not work on all platforms and the second method doesn't work in newer android verified boot (verity).

Given that the first method is preferable, because of its 'setting' kind of behavior and doesn't touch unnecessary system files. I am writing about a method of directly modifying the settings database to achieve the same result. There are many such android settings that can be edited / modified similarly. In any case, wm and similar tools help with editing the settings.

The file that we are interested in is:
/data/data/com.android.providers.settings/databases/settings.db

Pull this with various tools like fastboot. If Android is booted, one might need it rooted to access this file. [ Articles like How to Copy Files Over to your Android In a Bootloop with No OS using ADB! and The Most Useful Things You Can Do with ADB and Fastboot on Android might help for this ]

Insert / Update the dpi in settings - for this we'll use sqlite3. 'global' is the table that we are interested there, since this is part of the global settings in android.

sqlite3 settings.db
insert or replace into global values(null, 'display_density_forced', 160);
.quit

Push the file to the same location where we picked it from and we are done.





Monday, January 30, 2012

Ultimate PDF Converter (on Cloud)

Introduction

I wrote an android app and related server scripts for converting documents to pdf for viewing on the phone. The app can be downloaded here.
I wrote this for a few reasons including experimenting with AdMob, so caution: the app is an adware.

I have cleaned up the sources and uploaded it to google code.
The server scripts can be found here
and the android application can be found here

Some Technical Details
The flow is normally like the following:
  1. Android Application sends the file to the server using the upload.php script
  2. upload.php generates a unique key for this file and passes on the information to the app as well as updates the database
  3. The python converter polls this database and calls the converters (libreoffice/openoffice) and updates the database with success/failure
  4. The app now queries the getfile.php to get the file or the queue number it is in.
  5. The file (converted pdf file) is then downloaded to /sdcard
TODOs
  1. Change the irritating 'open with' to may be 'share with' rather
  2. Conversion of pdfs into maybe images for directly viewing from the app rather than opening it with another pdf viewer.
  3. Conversion of other files: e.g. audio files into wave screenshots or something (?)
  4. Robustness of the scripts and app needs improvement
Any contributors, please?

Wednesday, June 10, 2009

DVD Catalog - A CD/DVD Management Software

I was looking for an open source CD/DVD Management software for a long time. Didn't really find one - either I was looking at wrong places or searching for wrong key worlds (I guess this should be evident from the way I have named my creation :P).

I also wanted to see how good/bad QT SDK/framework is - heard its like write once and compile/run everywhere types.

So, I combined these two wishes and this summer I finally decided that I would start this project (that would be some 2 or 3 weeks back) and put in a few days of effort on it. Since my initial experiences with SQLite3 were really good, I chose to use it for this project as well. Last weekend I got it working with basic features up and running (like index a directory and search the database).

Try it out @ http://code.google.com/p/dvd-catalog Just extract and run the dvd-catalog.exe file
I only have win32 (Windows 32bit/64bit environments) binaries. I will be adding the Linux binaries in a few days, but I sure need help for adding the OS X binaries - I don't have an Apple MAC to build it on.
You can also download the source code there - I have released them as GPLv3. Don't complain on the code quality - its learning qt types :)
There are, of course, NO 'security-layer' or 'sql sanity checks' done. Hopefully I will do a few data sanity checks, but security layer, I guess is not required - since this is supposed to be a "personal" CD/DVD Management software.

Do comment on the improvements, code, ideas, ...I will sure consider them for implementation/correction/...

I guess, I need a few more features like:
0. Few improvements - like commit() only after all the entries are added to the database. I guess even though I am actually doing this, I see commit happening after ever add of the file. This would be a high priority.
1. Adding a single line entry (will be useful to add DVD Movies) into the database
2. Changing ratings
3. Indexing only directories (i.e directory names and not files)
Further,
4. Viewing reviews from internet (say imdb or wikipedia or software/games reviews) for a particular file/file type.

Also, let me know if you want to contribute to this project - I can add you to the list.


Few Screenshots: