Skip to main content

Posts

Showing posts from August, 2014

Display formatted date/time using String.format()

In this post we explains how to display formatted calendar using String.format().Let's hae a look.
Download and use... import java.util.Calendar; import android.app.Activity; import android.os.Bundle; import android.widget.TextView; public class MainActivity extends Activity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); TextView cal = (TextView)findViewById(R.id.viewdate); Calendar calendar = Calendar.getInstance(); cal.setText( String.format("%td-%tm-%tY\n", calendar, calendar, calendar) + String.format("%ty/%tm/%td\n", calendar, calendar, calendar) + String.format("%tI:%tM:%tS %tp\n", calendar, calendar, calendar, calendar) + "\n" + String.format("%tD\n", calendar) + String.format("%tc\n", calendar) + String…

Find great new apps and get tips for the ones you own with our brand new app pages

We're always working on new ways to make your experience of Android even better, and that
 goes for the AndroidPIT website too. We work hard every day to bring you the best app
 recommendations, hardware reviews and Android news, and today we're launching the alpha
 version of our new app overview portal. Our new app pages let you see, at a glance, all
 of the best Android apps available, and you can submit reviews, ask questions and become
 an app expert by sharing advice. 

 With the app overview pages, we wanted to create a new and user-friendly format for finding great new apps in a visually appealing way, that would also serve as a micro-forum for each particular app. Have a specific question about an app? Simply bring up the app profile and find your answer there. No answer to your question? Post it and get a response from one of our app experts or community members. The more you use them the more you learn. Answers can be rated by the community, so the best answer will …

Faster Loading images in GridViews or ListViews in Android using Menory Caching, Complete implemenation with sample code.

This example shows you how to load large images in the gridview without any lag or without outofmemory error.
This sample application uses the LruCache to hold the images.
A cache that holds strong references to a limited number of values. Each time a value is accessed, it is moved to the head of a queue. When a value is added to a full cache, the value at the end of that queue is evicted and may become eligible for garbage collection.

Read more from here.

http://developer.android.com/reference/android/util/LruCache.html

This is the MainActivity that holds the GridView. We are adding here 100 images in the Grid to load. This time I am loading images from the resources.

MainActivity.java
import java.util.ArrayList; import android.app.Activity; import android.os.Bundle; import android.widget.GridView; public class MainActivity extends Activity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); ArrayList&…

Different element with different background in CSS

The example explains how we can color different element with different backgrounds. <head> <style> h1 { background-color: #6395ed; } p { background-color: #e000ff; } div { background-color: #b000de; } </style> </head> <body> I'am colored <div> This is a colored div. This is a colored para We are still in the div element. </div> </body> </html>

Facebook 'colour change' virus is back, hits over 10,000 users

Have you tried to change the colour scheme of your Facebook profile lately? Beware of virus attack as a "colour change" malware is back and has already affected over 10,000 people around the world. The malware has been fixed by Facebook repeatedly but it has resurfaced again, reports added. It begins by advertising an app that tells Facebook users they can change the colour theme of their profile. Download the app and you are directed to a malicious phishing site, Mashable reported. The danger starts herewith. The website targets users by stealing their Facebook Access Tokens by asking them to view a colour changer tutorial video. Temporary access to the tokens allows hackers to connect to the user's Facebook friends. If a user does not view the video, the website tries to get them to download the malicious application. If a user is on a computer, the website leads them to download a pornographic video player. read more : http://businesstoday.intoday.in/story/f…

Mobile phones next big target of hackers!

Tempted to get a new mobile phone in exchange for your old battered one? Beware! Unethical hackers can crack into every shred of personal information you have on your gadget. For cyber criminals and unethical hackers, smartphones procured through exchanges are a catch in terms of getting access to valuable data related to finances and passwords, an expert said here. “The volume of data one uses on their phones these days is huge and because of accessibility to internet services such as phone banking and e-shopping, data about one’s debit and credit cards, passwords, photographs and videos, everything is available to hackers. read more : http://tech.firstpost.com/news-analysis/mobile-phones-next-big-target-hackers-228733.html