Posted by & filed under Android, Android Development, Homescreen Widget.

The problem is:
I have a big Android application. I want to add homescreen widget for this application.

I’ve followed official tutorial and created widget. It works.

Then I’ve include all widget’s code into my big application. Also I’ve declared widget in Android Manifest.

Then app was installed I didn’t see my widget into widget’s list.

WHY IT DIDN’T APPEARED?

The answer is very simple!

My app was installed into SD-card. Moving application to phone was fixed this issue.

Posted by & filed under General.

When you create your Rails project with PostgreSQL you might have following error after run rake db:create:all

[php]PG::Error: ERROR:  new encoding (UTF8) is incompatible with the encoding of the template database (SQL_ASCII)
HINT:  Use the same encoding as in the template database, or use template0 as template
[/php]

This error because template database (template1) has been created with an ASCII encoding and you’re екнштп to create the new database with UTF8.

 

I fixed that by adding ‘template’ parameter to my ‘database.yml’:

[php]
development:
adapter: postgresql
encoding: unicode
database: database_development
template: template0
pool: 5
username: username
password:
[/php]

Posted by & filed under Android, Android Development, Internet Connection, WiFi, WiFiManager.

Some Android applications can turn on/turn off WiFi on device. How to do same.

First of all you need specify uses-permission in Android Manifest file

And now you can enable wifi state via WiFiManager:

or disable:

That’s all.
Also you can DOWNLOAD source code of sample application.

The source code of main Activity is:

Android Manifest: