sqlite database is a very nice and powerful database and can easily embedded in your application. It have nice facility for create , insert,update and delete statement. It also supports various data types like int, real for float, text for string and etc. In android application you can find good wrappers for sqlite database.
I have also used sqlite database in estimation app which is available on google play store. This app gives facility to prepare estimates for the products/services they are selling. There is one screen in app where user can add item to estimation. Here in quantity field in earlier version we were using integer.
But recently one of our customer request to change quantity field to accept float values. I have search in google that how can i change table schema to accept float value which is integer. But after searching i found that sqlite database does not support alter statement at column level. But i found that there is a work around to update column type.
Rename original table with different name.
Create new table with same name as previous table have with desired column type.
Copy all previous data from old table (renamed table) to newly created table.
Drop renamed table.
Example table with all sql statements in steps, show table with three or four column only.
Let say we have one table called items which have below schema.
Few days before i have posted in google+ about android in app purchase. The discussion is totally interesting. Here is the link for google+ post https://plus.google.com/+ahesanalisuthar/posts/HckTGcAw8Gn
Here is text of post i have extracted.
I would like to integrate in-app purchases in my app.
But i have few questions.
If app user successfully purchase item how can i activate feature? Does another apk will be downloaded from playstore? Does google play developer console manages these?
If i have to manage in same app which is installed Should i use some persistance mechanism like database or shared preferences after user successfully made purchase? If yes than my most important question is , if user uninstall app or clear data from settings, how that purchase will be restored? Does user have to re-purchase that feature again?
After purchase you will obtain some response with product id. Then you can activate your feature – this is your responsibility.
You can save info about the purchase and use it in the app.
Also there is an API which allows to check if some product has been purchased. You can check this at the start-up of the app or have special option for do this. Anyway you should have this, because the store will not allow the user to buy the same product.
This is true if product is not consumable (i.e. not like extra money in the game).
Also take into account that there are can be following cases which can be handled if you check that the product has been purchased:
User redeem the product via promocode.
User buy the product on one device, but uses multiple devices (in this case the user think that the feature will be available on all devices).
They are stored on the Google Play server so if the app is reinstalled the user will get his purchases back.
Purchases are cached locally on the device so you don’t need to manage your own database of purchased items if you don’t want to. https://developer.android.com/google/play/billing/api.html#caching
3. +Christophe Beyls (https://plus.google.com/116805029264699613929) thanks, but how can i activate feature ?
Before user purchase feature how can i check that user has not yet made purchase so that let app disable that feature.
4. You disable the feature by default and only enable it when it is returned in the list returned by getPurchases().
5. Play store should cache the value, but it happens several times that is not true or the caching period is really too low, so yes, you need to have some backup because for example the device has no connectivity.
First of let me clear one thing that i have not much experience of writing ROR apps, nor i am favouring php as i have a some experience in it. Simplicity:
Talking about php language it is simple and easy to learn who knows c or other programming language.
Ruby is used in ROR. But it is not as simple as PHP.
To getting started with php you just haveto set up a local web server with php integrated like xampp or wamp and start developing with php in few minutes.
Wel with ROR you have to do a lot of excercise to setup working environment in your machine unless you use RailsInstalle.
The way we deploy php application is extremley makes me happy while working with php. I just change the code right away on the server and saved and my change in production. The biggest advantage is you can host your php application on shared host as well which is cheap.
Well to deploy ROR app you at least have vps pr it’s dedicated server like passenger. You must have to install all gems . So you have to manage your server too. Frameworks in Php:
RoR itself a framework in ruby which is awesome for rapid developement. In php there are numbers of framework you will find but i prefer laravel due to simplicity and it’s features.
I can say php is a lnguage where you can solve problems in a way that you know the logic.
Php is a very nice platform and programming langauge for building web application. To build web application we have to build dynamic html using php tags and have to process data. But presenting html is a different construct and processing data is a different construct. So if we would like to separete these both construct in php we have to use template system. Laravel provides awesome template engine but if we do not have to use laravel but it’s blade template engine we can.
We just have to add below dependency in our project composer.json file
I am mainting one web based product in php. Application is about hotel management for tariff calculation and all. My client has requested to email invoice as pdf generated by php based software.
I have divided process in two steps.
Dynamically Generate PDF file some where on the server using html css produces by php
Attach this generated pdf invoice in email
First of all I did tried using dompdf famous php library to generate HTML css invoice but due to incompatibility with tables i did not get accurate invoice pdf as i want. So i started searching on google and also posted on google+. Finally from my google+ php community post i came across wkhtmltopdf which is really nice tool and solve my problem.
Wkhtmltopdf is a command line utility that has nothing to do with php. But we can call this utility to generate pdf file from html.
When ever you have an array and you have to find an element or filter an array for different situation most of the time this is achieved by writing loop. Some times its okay to write loop. But php offers some nice set of array functions which can help you to achieve your goal without writing a loop.
Let say we have an array for a list of products.
If we want to increment each product price by 10%, we can achieve this by using array_map function.
you can do var_dump new product price have 10% more than previous one.
If i have to look for an item having category is mobile, array_filter can help here
If i would like to sum all products price array_reduce work out of box. array_reduce
In array_reduce function when callback function iterate over first item, $current_iteration_value is 0.
array_chunk is a function which i like most, i achieved pagination using this function.
It split array in to number of chunks.
Let say if we have numbers of products to display, where each page have only 22 products to display and whole products array have 500 products. You can achieve this by array_chunk
There are other good array_functions available in php which you can see here.
Don’t make me think book gives very nice explanation about web usablity for website designers and web product developers.
The book mainly focuses on general guideline about how to make a web pages so that a user doesn’t have to think much and can understand fast from the design and placement of the sections.
It also explain how to design different sections of the page so that user can easily identify what he/she is looking for and how to go back from here.
How a home page should look a like. What a home page should contain.
Book is really nice for a web developer as well web deigner.
Updated: 1st Aug, 2016
It also cover how we can do usability testing for our site. Author has covered nice explanation about usability testing and how we can proceed for such a testing with different different situation. If we have bar minimum team how we can test if we have enough budget should we have to higher professional for such testing.
Usability is not just about how we can use and how it looks good and attractive. But how user feels after using it first time. How it is easy and comfortable for them to use. Is it simple and map with their domain. Does it require to learn to use our web page. All these things matters.