Showing posts with label Android. Show all posts
Showing posts with label Android. Show all posts

Monday, April 11, 2016

SQL Performance enhancement for count function

SQL count aggregate function with case is helpful to reduce time to process sql db.
If you want count for any column bases on the value we can use the count function with case to reduce the processing time.

e..g. select count(case column1 when 'value1' then 1 else null end) as count1, count(case column1 when 'value2' then 1 else null end) as count2 from table1

Tuesday, October 9, 2012

cheapest dual core android india stellar horizon

cheapest dual core android india  stellar horizon



General Information
Brand Spice
Model Mi-500 Stellar Horizon
Weight 0 G
Form Factor Touch Bar
Dimensions 0x0x0 MM
Operating Frequency GSM 900 / 1800 / UMTS 2100 MHz | GSM 900 / 1800 / UMTS 2100 MHz
Dual Sim Yes, Dual SIM, Dual Standby
Touch Screen Yes, Capacitive Touchscreen

Display Details
Display Color 5.0 inches Capacitive Touchscreen
Display Size Spice Mi-500 Stellar Horizon has a display size of 480 x 800 px

Camera
Camera Yes, Rear Camera : 5.0 MP Camera (2592x1944 Pixels) with Auto Focus and LED Flash, Front Camera : 0.3 MP, VGA Camera (640x480 Pixels)
Camera Res. 2592 x 1944 Pixels 
Zoom Yes, Digital Zoom
Video Yes
Video Recording Yes
Video Player Yes, MP4 Player

Software
Games Yes
Java Yes
Browser Yes
Operating System Android OS, v2.3 (Gingerbread), upgrade to v4.0

Call Records
Phone Book Practically Unlimited
Missed Calls Practically unlimited
Received Calls Practically unlimited
Dialed Calls Practically unlimited

Battery
Stand By Time N/A
Talk Time N/A
Li-ion 2150 mAH
Memory
Internal Memory Yes, Internal Memory : 4 GB ROM + 512 MB RAM
External Memory Yes, Up to 32 GB
Memory Slot Yes, Micro SD/T-Flash Card

Message
SMS Yes
MMS Yes
Email Yes
Instant Messaging Yes
Social Networking Services Yes

Music
Ring Tone Vibration, Polyphonic, MP3
FM Yes, FM Radio
Music Yes, Music Formats : MP3, AAC, AAC+, WAV with Loud Speaker, 3.5mm Audio Jack
Speaker Yes
Headset Yes

Data
GPRS Yes
Bluetooth Yes
Wirless Protocol Yes, Wi-Fi 802.11 b/g, Wi-Fi Tethering
Port Yes, USB Port
Edge Yes
Infra Red No
3G Yes
GPS Yes
CPU Yes, Dual core 1GHz processor
Salespack Handset, Battery, Charger, Earphone, USB Cable, User Manual, Warranty Card

Others
Applications :
Secured by NQ Mobile Security Apps

Colours
Black




Spice MI-500

Wednesday, August 8, 2012

transparent activity android

Add the following style In your res/values/styles.xml file (if you don’t have one, create it.) Here’s a complete file:
<?xml version="1.0" encoding="utf-8"?>
<resources>
  <style name="Theme.Transparent" parent="android:Theme">
    <item name="android:windowIsTranslucent">true</item>
    <item name="android:windowBackground">@android:color/transparent</item>
    <item name="android:windowContentOverlay">@null</item>
    <item name="android:windowNoTitle">true</item>
    <item name="android:windowIsFloating">true</item>
    <item name="android:backgroundDimEnabled">false</item>
  </style>
</resources>
(the value @color/transparent is the color value #00000000 which I put in res/values/color.xml file. You can also use @android:color/transparent in later Android versions)
Then apply the style to your activity, for example:
<activity android:name=".SampleActivity" android:theme="@style/Theme.Transparent">
...</activity>

pick a image from gallery (SD Card) for my app in android

Here's some sample code on how to do that:
protected void onActivityResult(int requestCode, int resultCode, Intent imageReturnedIntent) { 
    super.onActivityResult(requestCode, resultCode, imageReturnedIntent); 

    switch(requestCode) { 
    case REQ_CODE_PICK_IMAGE:
        if(resultCode == RESULT_OK){  
            Uri selectedImage = imageReturnedIntent.getData();
            String[] filePathColumn = {MediaStore.Images.Media.DATA};

            Cursor cursor = getContentResolver().query(selectedImage, filePathColumn, null, null, null);
            cursor.moveToFirst();

            int columnIndex = cursor.getColumnIndex(filePathColumn[0]);
            String filePath = cursor.getString(columnIndex);
            cursor.close();


            Bitmap yourSelectedImage = BitmapFactory.decodeFile(filePath);
        }
    }
}

set HttpResponse timeout for Android in Java

HttpGet httpGet = new HttpGet(url);
HttpParams httpParameters = new BasicHttpParams();
// Set the timeout in milliseconds until a connection is established.
// The default value is zero, that means the timeout is not used. 
int timeoutConnection = 3000;
HttpConnectionParams.setConnectionTimeout(httpParameters, timeoutConnection);
// Set the default socket timeout (SO_TIMEOUT) 
// in milliseconds which is the timeout for waiting for data.
int timeoutSocket = 5000;
HttpConnectionParams.setSoTimeout(httpParameters, timeoutSocket);
DefaultHttpClient httpClient = new DefaultHttpClient(httpParameters);
HttpResponse response = httpClient.execute(httpGet);

If you want to set the Parameters of any existing HTTPClient (e.g. DefaultHttpClient or AndroidHttpClient) you can use the function setParams().
httpClient.setParams(httpParameters);

check internet access on android

here is the code which will help to check internet available

public boolean isOnline() {
    ConnectivityManager cm =
        (ConnectivityManager) getSystemService(Context.CONNECTIVITY_SERVICE);
    NetworkInfo netInfo = cm.getActiveNetworkInfo();
    if (netInfo != null && netInfo.isConnectedOrConnecting()) {
        return true;
    }
    return false;
}

Tutorials and libraries for OpenGL-ES games on Android

Android tutorials:
Other Android OpenGL-ES information:
iPhone OpenGL-ES tutorials (where the OpenGl-ES information is probably useful):
As for libraries which a beginner might use to get a simpler hands-on experience with OpenGL-ES, I have only found Rokon, which is recently started, thus has many holes and bugs. And it's gnuGPL licensed (at the moment) which means it cannot be used, if we wish to sell our games.

1.  INsanityDesign
2.  nehe

Monday, August 6, 2012

hide Android Soft Keyboard

hide Android Soft Keyboard

 You can force Android to hide the virtual keyboard using the InputMethodManager, calling hideSoftInputFromWindow, passing in the token of the window containing your edit field.

InputMethodManager imm = (InputMethodManager)getSystemService(
      Context.INPUT_METHOD_SERVICE);
imm.hideSoftInputFromWindow(myEditText.getWindowToken(), 0);
This will force the keyboard to be hidden in all situations. In some cases you will want to pass in InputMethodManager.HIDE_IMPLICIT_ONLY as the second parameter to ensure you only hide the keyboard when the user didn't explicitly force it to appear (by holding down menu).

 Also useful for hiding the soft keyboard is:

getWindow().setSoftInputMode(
      WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_HIDDEN);
This can be used to suppress the keyboard until the user actually touches the edittext view.


Difference between px, dp, dip and sp in Android

A dimension value defined in XML. A dimension is specified with a number followed by a unit of measure. For example: 10px, 2in, 5sp. The following units of measure are supported by Android:
dp
Density-independent Pixels - An abstract unit that is based on the physical density of the screen. These units are relative to a 160 dpi (dots per inch) screen, on which 1dp is roughly equal to 1px. When running on a higher density screen, the number of pixels used to draw 1dp is scaled up by a factor appropriate for the screen's dpi. Likewise, when on a lower density screen, the number of pixels used for 1dp is scaled down. The ratio of dp-to-pixel will change with the screen density, but not necessarily in direct proportion. Using dp units (instead of px units) is a simple solution to making the view dimensions in your layout resize properly for different screen densities. In other words, it provides consistency for the real-world sizes of your UI elements across different devices.
sp
Scale-independent Pixels - This is like the dp unit, but it is also scaled by the user's font size preference. It is recommend you use this unit when specifying font sizes, so they will be adjusted for both the screen density and the user's preference.
pt
Points - 1/72 of an inch based on the physical size of the screen.
px
Pixels - Corresponds to actual pixels on the screen. This unit of measure is not recommended because the actual representation can vary across devices; each devices may have a different number of pixels per inch and may have more or fewer total pixels available on the screen.
mm
Millimeters - Based on the physical size of the screen.
in
Inches - Based on the physical size of the screen.
Note: A dimension is a simple resource that is referenced using the value provided in the name attribute (not the name of the XML file). As such, you can combine dimension resources with other simple resources in the one XML file, under one <resources> element.

“Debug certificate expired” error in Eclipse Android plugins

Here is the solution for your problem

Delete your debug certificate under ~/.android/debug.keystore on Linux and Mac OS X; the directory is something like %USERPROFILE%/.androidon Windows.
The Eclipse plugin should then generate a new certificate when you next try to build a debug package. You may need to clean and then build to generate the certificate.

Saturday, June 2, 2012

Google: Ice Cream Sandwich now accounts for 7.1 percent of Android user base

Well, it's about time that Ice Cream Sandwich made some headway -- even if the process is much slower than consumers deserve. According to the Android developer hub, Android 4.0 now accounts for 7.1 percent of all Android smartphone and tablet installations, which is a sharp and welcome increase over the 2.9 percent figure that we reported just two months ago. Naturally, Gingerbread users still account for the lion's share of the Android ecosystem with 65 percent, but it's worth pointing out that this segment also grew during the last month -- no doubt at the expense of Froyo and Eclair. Don't know about you, but we like our desserts fresh, thank you very much. Go ahead and hop the break to see the full breakdown.

Thursday, May 24, 2012

Google brings in-app subscriptions to Android

Developers can never have too many options when it comes to ways to take your money. Google has opened the doors to In-app purchases, carrier billing and now, in-app subscriptions. Perhaps it wasn't enough that game creators be able to lure you in with perks and content you could purchase for a one-time fee, now devs can choose to hit you with a monthly charge for the privilege of using their wares. Of course, it's not all that bad. Subscription-based games aren't the only potential uses here. Customers can now buy monthly or annual subscriptions to services or publications as well. There's even a publisher API for extending the subscription beyond the walls of Google Play and your Android device. Glu Mobile will be first out the gate, turning on subscriptions in properties like Frontline Commando, but we're sure plenty of others will follow. Soon enough you might be able to get your New York Times subscription or Spotify Premium account without ever leaving the comfort of the Android app. Any handset with Google Play 3.5 or higher installed should have access to subscriptions starting today.

Friday, April 27, 2012

Samsung Galaxy S Advance gets April 30th release date in UK, needs more suffixes

Pitched spec-wise somewhere between Samsung's first Galaxy S and its very popular sequel, think of the Galaxy S Advance as the original, reimagined for a new generation -- a generation that remembers only a few years back. The attractive Super AMOLED display with dual-core bones caught our eye at MWC a few months earlier and will finally arrive on rain-soaked British shores on April 30th at the like of Phones 4u and Vodafone. The bad news? It's still toting that Touchwizzed Gingerbread, and arrives just days before Samsung shows what it's been hiding in its top-spec drawers.

Tuesday, April 24, 2012

Transformer Prime gets power of reincarnation with Team Win Recovery Project 2.1.2

Known affectionately as Twrp, this handy utility allows you to backup and recover your Android world even as you flit effortlessly between different custom ROMs. Two-point-oh worked great on a limited selection of devices, like the Nexus S, Kindle Fire and TouchPad, but this latest update brings improved support for Honeycomb tablets and ICS handsets like the Galaxy Nexus, while also doing its thing on the Transformer Prime for the first time. Team Win has even introduced a OpenRecoveryScript function, which lets apps influence the recovery process in order to preserve even more consciousness across rebirths. Now, if only we could root karma.