×

Get the Blog Updates

Your information will not be shared with any 3rd parties under any circumstances.
Cancel
Image Image Image Image Image
Scroll to Top

To Top

Scroll to Top

To Top

Search Results for: label/android application Development

29

Nov
2011

No Comments

In Android

By Jay Dee

Various Resourceful Places to Find Amazing New Android Apps for Android Development

On 29, Nov 2011 | No Comments | In Android | By Jay Dee

androidNow-a- days iPhone apps stores are the king in the market. Android market is growing day by day. The online apps store has reached the 20,000 mark and it is doubled as compared to the last five months. End users and Android developers struggle to get appropriate applications to meet their needs. There are various websites which are providing wonderful android mobile apps. as listed below,

Android website: Here one can get the latest apps and games. It is the showcase for some of the featured and top ranked applications and games available. The site has various lists of featured and top apps with brief descriptions with screenshots each.

Androlib: This is an online marketing store of Android apps known to human being. Here one can search apps thorough categorized. You can also get frank user reviews, screenshots, and QR codes for download, and, video demonstrations of apps. The site also contains stats, forums and special sections for games and the top app of the day

Cyrket: Cyrket is the holy grail of Android-related sites. This is the advanced data analysis and extraction which helps users to find their needed apps to buy and to allow android developers to learn how their applications fit into the mobile application. QR codes, screenshots, descriptions and user comments for most apps are available here. User can search Apps or sort by popularity, rating, price and other factors.

AndroidZoom: AndroidZoom is an easy-to-use app directory. Here the app pages contain descriptions, screenshots, rating and QR codes, but user cannot give feedback, reviews or comments on a specific app. The site does, however, show similar or related apps from the same and other developers.

Android applications are more flexible smart phones operating system whose features have increased to satisfy the users and moving it in to a new level of opportunity. Many software development companies are spending their time in developing various applications in Android but Andolasoft inc. is one of the best Android application development company in the market.

We have developed many mobile applications as per the client and user requirements. We have a team of dedicated, skilled and creative Android application developers to develop apps like shopping list, to do list, multimedia gaming applications, Social networking application, business and web based apps for various customer requirements

 

Tags | ,

19

Apr
2013

No Comments

In Android

By Jay Dee

Example of Webview Layouts and How to use in Android

On 19, Apr 2013 | No Comments | In Android | By Jay Dee

clip_image002-176x300

What is WebView class?

The WebView class is a subclass of “android.view” class that facilitates to fetch external URL running in web server and display it in device’s screen. It is specifically useful for displaying dynamic contents from the web server application. However, it will show only the contents, not the features of a fully html based web browser functionality.

In the WebView app, we implemented following steps to display the web content on device and also enabling the app to upload file to the web page contents:

  1. Verify the availability of device’s network connection
  2. Add progress bar logic for on click event of hyper-link in web page
  3. Add ability to upload file from local file storage on device through webview.

The only Requirement is…

External website URL should have UI contents compatible with the android device’s screen resolution.

Example of xml for activity

android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>

android:id="@+id/webview1"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
/>

Example of Main Activity class

1.MainClass.java
=======================
package com.webviewdemo;
import java.security.KeyManagementException;
import java.security.NoSuchAlgorithmException;
import java.security.SecureRandom;
import javax.net.ssl.HttpsURLConnection;
import javax.net.ssl.SSLContext;
import javax.net.ssl.TrustManager;
import android.app.Activity;
import android.app.AlertDialog;
import android.app.ProgressDialog;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.graphics.Bitmap;
import android.net.ConnectivityManager;
import android.net.Uri;
import android.net.http.SslError;
import android.os.Bundle;
import android.view.KeyEvent;
import android.view.View;
import android.view.Window;
import android.webkit.SslErrorHandler;
import android.webkit.ValueCallback;
import android.webkit.WebChromeClient;
import android.webkit.WebSettings;
import android.webkit.WebView;
import android.webkit.WebViewClient;
import android.widget.ProgressBar;
import android.widget.Toast;
public class MainClass extends Activity {

WebView webview;
ProgressDialog  progressBar;
ProgressBar progressBar1;
MainClass _activity;
AlertDialog alertDialog;
boolean loadingFinished = true;
boolean redirect = false;
private ValueCallback mUploadMessage;
private final static int FILECHOOSER_RESULTCODE = 1;
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
progressBar = null;
this.getWindow().requestFeature(Window.FEATURE_PROGRESS);
_activity = this;
setContentView(R.layout.main );
webview = (WebView) findViewById( R.id.webview1 );
WebSettings settings = webview.getSettings();
settings.setJavaScriptEnabled(true);
settings.setSupportZoom(true);
settings.setBuiltInZoomControls(true);
settings.setCacheMode(WebSettings.LOAD_NO_CACHE);
webview.setScrollBarStyle(WebView.SCROLLBARS_OUTSIDE_OVERLAY);
webview.setWebChromeClient(new WebChromeClient()
{
//The undocumented magic method override
//Eclipse will swear at you if you try to put @Override here
public void openFileChooser(ValueCallback uploadMsg) {
mUploadMessage = uploadMsg;
Intent i = new Intent(Intent.ACTION_GET_CONTENT);
i.addCategory(Intent.CATEGORY_OPENABLE);
i.setType("image/*");
MainClass.this.startActivityForResult(Intent.createChooser(i,"File Chooser"), FILECHOOSER_RESULTCODE);
}
});
if(checkInternetConnection(_activity)==true){
if(savedInstanceState==null)
webview.loadUrl("http://www.andolasoft.com/");
else
webview.loadUrl("http://www.andolasoft.com/");
alertDialog = new AlertDialog.Builder(this).create();
progressBar = ProgressDialog.show(MainClass.this, "Please wait...", "Loading...");
webview.setWebViewClient(new WebViewClient() {
@Override
public boolean shouldOverrideUrlLoading(WebView view, String urlNewString) {
if (!loadingFinished) {
redirect = true;
}
loadingFinished = false;
webview.loadUrl(urlNewString);
return true;
}
public void onReceivedSslError (WebView view, SslErrorHandler handler, SslError error) {
handler.proceed() ;
}
@Override
public void onPageFinished(WebView view, String url) {
if(!redirect){
loadingFinished = true;
}
if(loadingFinished && !redirect){
//HIDE LOADING IT HAS FINISHED
if (progressBar != null && progressBar.isShowing()) {
progressBar.hide();
}
} else{
redirect = false;
}
}
@Override
public void onPageStarted(WebView view, String url, Bitmap favicon) {
super.onPageStarted(view, url, favicon);
loadingFinished = false;
progressBar.show();
}});
}
else{
AlertDialog.Builder builder = new AlertDialog.Builder(_activity);
builder.setMessage("Please check your network connection.")
.setCancelable(false)
.setPositiveButton("OK", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int id) {
Intent intent = new Intent(Intent.ACTION_MAIN);
intent.addCategory(Intent.CATEGORY_HOME);
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
startActivity(intent);
finish();
}
});

AlertDialog alert = builder.create();
alert.show();
}
}

public static boolean checkInternetConnection(Activity _activity) {
ConnectivityManager conMgr = (ConnectivityManager) _activity.getSystemService(Context.CONNECTIVITY_SERVICE);
if (conMgr.getActiveNetworkInfo() != null
&& conMgr.getActiveNetworkInfo().isAvailable()
&& conMgr.getActiveNetworkInfo().isConnected())
return true;
else
return false;
}
@Override
protected void onActivityResult(int requestCode, int resultCode,
Intent intent) {
if (requestCode == FILECHOOSER_RESULTCODE) {
if (null == mUploadMessage)
return;
Uri result = intent == null || resultCode != RESULT_OK ? null
: intent.getData();
mUploadMessage.onReceiveValue(result);
mUploadMessage = null;

}
}
@Override
public boolean onKeyDown(int keyCode, KeyEvent event) {
if (keyCode == KeyEvent.KEYCODE_BACK){
if(webview.canGoBack()){
webview.goBack();
return true;
}
}
return super.onKeyDown(keyCode, event);
}
}

Example of User’s permission mentioned in androidmanifest.xml


WebView is really helpful in creating quick Mobile UI without using complex Views/Layouts of Android. A HTML developer can easily build a web page with dynamic contents using CSS/HTML tags. Generally, we can run everything on WebView i.e., in android browser we can run jQuery, Flash enabled app while replicating the web based platform to mobile based smaller screen.

Benefits:

WebView are useful in following cases:

  • Since the web contents are dynamically updated at server side, the android app will display the updated contents just by fetching from site through WebView.
  • Web apps can be easily integrated to native application through WebView controls.

Tags |

11

Jul
2015

No Comments

In Android
Infographic

By Omkar

How to Integrate Facebook SDK to your Android App

On 11, Jul 2015 | No Comments | In Android, Infographic | By Omkar

Banner_Android_0629_v2 (1)With the gaining enourmous popularity Android Apps are a part of our everyday life with a whopping 1.5 million apps in Google Play Store to choose from. The Facebook SDK for Android is meant for integrating the Android app with Facebook such as support for Login with Facebook authentication, reading and writing to Facebook.

In this article, I am going to discuss about how to integrate the Facebook SDK. The infographic explains the initial setup you have to do for getting started with Android with Facebook social apps integration.

Android_Infographics_0710_v2

With all the steps, you will complete Facebook SDK setup. If you feel this article is helpful and interesting please spread a word about it to your friends and colleagues by sharing this article in Facebook, LinkedIn or Twitter.

We will be glad to receive any positive comments or view. Please Visit Andolasoft’s Android Service for more information and details. You can also write to us at info@andolasoft.com.

Tags | ,

01

Apr
2013

No Comments

In Android

By Jay Dee

Expected devices with Android 4.2 upgrades

On 01, Apr 2013 | No Comments | In Android | By Jay Dee

android_jelly_been_123

Google’s Android 4.2 was released last October, which introduced numerous new features and enhancement for Jelly Bean OS platform. It included lock screen widgets and photo Sphere as well as new quick settings panel and screensaver function. For tablets, the upgrade included phone like user-interfaces and multi-user support

It has been nearly a year since the release of Samsung Galaxy Tab and apparently Samsung is planning to release an update to Android 4.1.2 first and then the final OTA Update with Android 4.2.2 Jelly Bean OS for the tablet. This will be the last official update from Samsung and hence further the users will have to rely on the Android development community for custom ROMs based on Android 5.0. The news first surfaced at ‘SamMobile’ and it seems like Samsung has fixed issues with Android 4.2.2 and Exynos CPU. Samsung will probably abandon updates for its former flagship tablet after the release of Jelly Bean 4.2.2 firmware update. These update i.e. Android 4.2.1 and 4.2.2 is expected to be available till September 2013. It is also rumored that Samsung devices with dual-core CPU will also receive Jelly Bean 4.2.2 updates.

There were other Galaxy Tab devices that are tested on Jelly Bean ROMs and its official release is expected by April 2013. The Jelly Bean OS is now tested on Galaxy Tab 10.1 GT 7500, Galaxy Tab GT 7300, Galaxy Tab 7.7 P6800 and the Galaxy Tab Plus P6200. These updates are yet to happen until Samsung decides to officially announce the release dates of OTA updates for Jelly Bean 4.2.2.

For Google’s nexus devices the upgrades are often early and directly from Google. Even carrier connected devices like the Verizon Galaxy Nexus are finally catching up, which generally experienced delays in update because of carrier interference. Asus gave Android 4.2 update to its Transformer Pad TF300 at the beginning of March and has said to release updates for Transformer Pad Infinity, MeMO Pad Smart and MeMO Pad, later this year. Sony has confirmed that it would release Android 4.2 upgrades for Xperia Z and Xperia Tablet Z devices. Motorola has also promised it would upgrade their Android OS for Motorola’s International Razr D1 and D3, but haven’t provided any definite timeline for the process.

Mobile device manufacturers are now willing to focus their Android Application Development efforts on Android 4.1 upgrade before heading to 4.2, because 4.2 is relatively a minor step from 4.1. Some companies are even considering to skip directly to the next major Android release i.e. Android Key Lime Pie, which is expected to be announced at Google’s I/O conference in May .

Tags | ,

16

Aug
2015

No Comments

In Android
Infographic

By Omkar

7 Quick Steps to Get Started with Material Design on Android

On 16, Aug 2015 | No Comments | In Android, Infographic | By Omkar

Banner_Android_0806_v2What is Material Design!

Material design introduced in Android Lollipop. A lot of new things are added in material designs such as new widgets, custom shadows, custom animations and more. However, there are certain principles and guidelines for every design implementation.

Android_Infographics_0805New widgets and components in Material Design

Toolbar and Statusbar:

Now, instead of actionbar we are using toolbar because actionbar is deprecated. Statusbar is above toolbar where you see notification icons. It’s more flexible and you can use different color patterns.

Color pattern for toolbar and statusbar:

Toolbars and larger color blocks should use the primary 500 color, which should be the primary color of your Android app. The statusbar color on the other hand should be darker than primary color, i.e. somewhere around 700 tint of your primary color. For color references, check – Google ‘Material Design Color Page’.

Accent color – It is generally used for your primary action button or floating action button and components like switches.

Just try it yourself 

With all the steps mentioned above, you will be able integrate material design in your Android App. If you feel this article is helpful and interesting, please spread a word about it to your friends & teammates by sharing this article on Facebook, LinkedIn or Twitter.

We will be glad to receive any comments or view. For any further assistance our Android experts will be happy to help. Please Visit Andolasoft’s Android Service for more information and details. You can also write to us at info@andolasoft.com

Bottom_Banner_WP_0810

Tags | , , , ,

13

May
2015

No Comments

In Android

By Omkar

Will ‘Fragment’ rule over ‘Activity’ the Android World in the Future?

On 13, May 2015 | No Comments | In Android | By Omkar

Banner_Androi1

Why to Use Fragment? What Is It All About!

A Fragment is an application’s user interface that can be placed in an activity which will enable more modular activity design for an application.You would be able to add multiple fragments in a single activity to create a multi-pane user interface and can reuse a fragment in many activities.

Fragment is a modular section/standard of an activity, which has its own life-cycle, model. It receives its own input events which you can add or remove while the activity is running (like a ‘sub activity’ that you can reuse in different activities).Fragments were added to the Android API in Honeycomb version which is API version 11.

Now, lets find out the benefits, steps to implememt fragment as explained in the infographics.

Android_Infographics_Fragment_0512_v6

Wrapping Up

Fragments are truly a masterpiece, secret Ingredient to Android App Designing.
We hope this article helps you to understand the concept of using fragment in Android Apps. We will be glad to receive any positive comments or view. Please Visit Andolasoft’s Android Service for more information and details. You can also write to us at info@andolasoft.com

To display the infographic in your site, use the below code

Tags | ,

11

Apr
2013

No Comments

In Android

By Jay Dee

How to Use Fragment Layouts in Android

On 11, Apr 2013 | No Comments | In Android | By Jay Dee

android-293x300-123

Fragment is a concept of UI components-with a new idea for the ability to retain state across configuration changes. As a result, web-pages load comparatively faster because it retains their previous state. Without Fragments components, the normal activity class causes running activities to be stopped, reloaded and re-rendered using the new parameters. A fragment allows building a UI as a series of smaller, reusable graphical elements that can be arranged as needed, based on the device’s capabilities.

Fragment layout in Android is pretty distinct from other platforms. This design was first introduced for the platform in version 3.0 and onwards.

Here are the main concepts about Android fragment layout:

  • Android tabs are most often presented as text compared to icons, because it is difficult to come up with descriptive icons for all the possible navigation option. Text is much better.
  • Android tabs aren’t square buttons.  They mostly contain text
  • Visual style of Android tabs is flat. There should not be any glossy or reflection effects like in html web design.

A Fragment framework works much like an activity.
To implement it in the app we need an independent Java activity class along with a fragment xml layout:

  1. Create a layout XML and an Activity subclass for your activity
  2. Create a layout XML and a Fragment subclass for your fragment
  3. Map the two together in your Activity layout XML (or using FragmentTransaction mostly in Java code)

Example of layout xml for activity

<?xml version="1.0" encoding="utf-8"?>
<TabHost
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@android:id/tabhost"
android:layout_width="fill_parent"
android:layout_height="fill_parent">

<LinearLayout
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent">

<FrameLayout
android:id="@android:id/tabcontent"
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_weight="0"/>

<FrameLayout
android:id="@+android:id/realtabcontent"
android:layout_width="fill_parent"
android:layout_height="0dp"
android:layout_weight="1"/>

<TabWidget
android:id="@android:id/tabs"
android:orientation="horizontal"
android:layout_width="fill_parent"
android:layout_height="55dip"
android:layout_weight="0"/>

</LinearLayout>
</TabHost>

Example of Activity subclass

package com.myproj;

import java.util.HashMap;
import java.util.Iterator;
import java.util.Stack;

import android.annotation.SuppressLint;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentActivity;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentTransaction;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.ImageView;
import android.widget.TabHost;
import android.widget.TextView;

public class AppMainTabActivity extends FragmentActivity {
/* Your Tab host */
private TabHost mTabHost;

/* A HashMap of stacks, where we use tab identifier as keys..*/
private HashMap<String, Stack<Fragment>> mStacks;

/*Save current tabs identifier in this..*/
private String mCurrentTab;

protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.fragment_layout);
/*
*  Navigation stacks for each tab gets created..
*  tab identifier is used as key to get respective stack for each tab
*/
mStacks = new HashMap<String, Stack<Fragment>>();
mStacks.put(AppConstants.TAB_A, new Stack<Fragment>());
mStacks.put(AppConstants.TAB_B, new Stack<Fragment>());
mStacks.put(AppConstants.TAB_C, new Stack<Fragment>());
mStacks.put(AppConstants.TAB_D, new Stack<Fragment>());
mTabHost = (TabHost)findViewById(android.R.id.tabhost);
mTabHost.setOnTabChangedListener(listener);
mTabHost.setup();
initializeTabs();
}

private View createTabView(final int id,String s) {
View view = LayoutInflater.from(this).inflate(R.layout.tabs_icon, null);
ImageView imageView =   (ImageView) view.findViewById(R.id.icon);
imageView.setImageDrawable(getResources().getDrawable(id));
TextView textview= (TextView) view.findViewById(R.id.title);
textview.setText(s);
return view;
}

public void initializeTabs(){
/* Setup your tab icons and content views.. Nothing special in this..*/
TabHost.TabSpec spec    =   mTabHost.newTabSpec(AppConstants.TAB_A);
mTabHost.setCurrentTab(-3);
spec.setContent(new TabHost.TabContentFactory() {
public View createTabContent(String tag) {
return findViewById(R.id.realtabcontent);
}
});
spec.setIndicator(createTabView(R.drawable.cameratab, "Camera"));
mTabHost.addTab(spec);

spec = mTabHost.newTabSpec(AppConstants.TAB_B);
spec.setContent(new TabHost.TabContentFactory() {
public View createTabContent(String tag) {
return findViewById(R.id.realtabcontent);
}
});
spec.setIndicator(createTabView(R.drawable.presettab, "Presets"));
mTabHost.addTab(spec);

//Create a class AppConstants to declare your variables

spec = mTabHost.newTabSpec(AppConstants.TAB_C);
spec.setContent(new TabHost.TabContentFactory() {
public View createTabContent(String tag) {
return findViewById(R.id.realtabcontent);
}
});
spec.setIndicator(createTabView(R.drawable.manualtab, "Manual Entry"));

mTabHost.addTab(spec);

spec = mTabHost.newTabSpec(AppConstants.TAB_D);
spec.setContent(new TabHost.TabContentFactory() {
public View createTabContent(String tag) {
return findViewById(R.id.realtabcontent);
}
});
spec.setIndicator(createTabView(R.drawable.infotab, "Info"));
mTabHost.addTab(spec);
}

/*Comes here when user switch tab, or we do programmatically*/
TabHost.OnTabChangeListener listener    =   new
TabHost.OnTabChangeListener() {
public void onTabChanged(String tabId) {
/*Set current tab..*/
mCurrentTab                     =   tabId;

if(mStacks.get(tabId).size() == 0){
/*
*    First time this tab is selected. So add first fragment of that tab.
*    Dont need animation, so that argument is false.
*    We are adding a new fragment which is not present in stack. So add to stack is true.
*/
if(tabId.equals(AppConstants.TAB_A)){
pushFragments(tabId, new Camera(), false,true);
}else if(tabId.equals(AppConstants.TAB_B)){
pushFragments(tabId, new PresetsActivity(), false,true);
}else if(tabId.equals(AppConstants.TAB_C)){
pushFragments(tabId, new ManualActivity(), false,true);
}else if(tabId.equals(AppConstants.TAB_D)){
pushFragments(tabId, new InfoActivity(), false,true);
}
}else {
/*
*    We are switching tabs, and target tab is already has atleast one fragment.
*    No need of animation, no need of stack pushing. Just show the target fragment
*/
pushFragments(tabId, mStacks.get(tabId).lastElement(), false,false);
}
}
};

/* Might be useful if we want to switch tab programmatically, from
inside any of the fragment.*/
public void setCurrentTab(int val){
mTabHost.setCurrentTab(val);
}

/*
*      To add fragment to a tab.
*  tag             ->  Tab identifier
*  fragment        ->  Fragment to show, in tab identified by tag
*  shouldAnimate   ->  should animate transaction. false when we switch tabs, or adding first fragment to a tab
*                      true when when we are pushing more fragment into navigation stack.
*  shouldAdd       ->  Should add to fragment navigation stack (mStacks.get(tag)). false when we are switching tabs (except for the first time)
*                      true in all other cases.
*/
public void pushFragments(String tag, Fragment fragment,boolean shouldAnimate, boolean shouldAdd){
if(shouldAdd)
mStacks.get(tag).push(fragment);
FragmentManager   manager         =   getSupportFragmentManager();
FragmentTransaction ft            =   manager.beginTransaction();
if(shouldAnimate)
ft.setCustomAnimations(R.anim.slide_in_right, R.anim.slide_out_left);
ft.replace(R.id.realtabcontent, fragment);
ft.commit();
}

public void popFragments(){
/*
*    Select the second last fragment in current tab's stack..
*    which will be shown after the fragment transaction given below
*/
Fragment fragment             =   mStacks.get(mCurrentTab).elementAt(mStacks.get(mCurrentTab).size() - 2);

/*pop current fragment from stack.. */
mStacks.get(mCurrentTab).pop();

/* We have the target fragment in hand.. Just show it.. Show a standard navigation animation*/
FragmentManager   manager         =   getSupportFragmentManager();
FragmentTransaction ft            =   manager.beginTransaction();
ft.setCustomAnimations(R.anim.slide_in_left, R.anim.slide_out_right);
ft.replace(R.id.realtabcontent, fragment);
ft.commit();
}

@SuppressLint("NewApi")
@Override
public void onBackPressed() {
if(((BaseFragment)mStacks.get(mCurrentTab).lastElement()).onBackPressed() == false){
/*
* top fragment in current tab doesn't handles back press, we can do our thing, which is
*
* if current tab has only one fragment in stack, ie first fragment is showing for this tab.
*        finish the activity
* else
*        pop to previous fragment in stack for the same tab
*
*/
if(mStacks.get(mCurrentTab).size() == 1){
super.onBackPressed();  // or call finish..
}else{
popFragments();
}
}else{
//do nothing.. fragment already handled back button press.
}
}

/*
*   Imagine if you wanted to get an image selected using ImagePicker intent to the fragment. Ofcourse I could have created a public function
*  in that fragment, and called it from the activity. But couldn't resist myself.
*/
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {

mStacks.get(mCurrentTab).lastElement().onActivityResult(requestCode, resultCode, data);
}
}

Example of Fragment subclass

package com.myproj;

import android.content.Intent;
import android.os.Bundle;
import android.support.v4.app.Fragment;

public class BaseFragment extends Fragment {
public AppMainTabActivity mActivity;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);

mActivity    = (AppMainTabActivity) this.getActivity();
}

public boolean onBackPressed(){
return false;
}
public void onActivityResult(int requestCode, int resultCode, Intent data){

}
}

Fragment layout in Android is pretty distinct from other platforms. This design was first introduced for the platform in version 3.0 and onwards.

Here are the main concepts about Android fragment layout:

  1. Android tabs are most often presented as text compared to icons. Because, it is difficult to come up with descriptive icons for all the possible navigation option. Text is much better.
  2. Android tabs aren’t square buttons.  They mostly contain text
  3. Visual style of Android tabs is flat. There should not be any glossy or reflection effects like in html web design.

A fragment must always be embedded in an activity and the fragment’s lifecycle is directly affected by the parent activity’s lifecycle. When we add a fragment as a part of an activity layout, it lives in ViewGroup inside the activity’s view hierarchy and the fragment defines its own view layout. We can insert a fragment into the activity layout by declaring the fragment in the activity’s layout file, as a <fragment> element, or from the application code by adding it to an existing ViewGroup.
To animate the transition between fragments or to animate the process of showing or hiding a fragment the Fragment Manager API can be used and create a Fragment Transaction.
Within each Fragment Transaction we can specify in and out animations that will be used for show and hide respectively (or both when replace is used).

Benefits:

Fragments are useful in following cases:

  • If we split up views on some devices/orientations and show them in two activities and show all the content in one on other devices. That would be a use case if you go on a tablet or maybe even in landscape mode on a phone: e.g. you show the list of items and the details on one screen. On a phone or in portrait mode you just show one part.
  • Another use case is reusable views. So if we have some views that are visible on different activities and also perform some actions we could put this behavior into a fragment and then reuse it.
  • Animated effects can availed when dynamically adding and removing fragments from the screen
  • Integration with the action bar for tabs, as a replacement for TabHost
  • Integration with the action bar for “list”-based navigation (really a Spinner in the action bar, toggling between different fragments)
See Also: Webview Layouts usages in Android

If you have thoughts about or experiences with Android fragments, share them with us. We’d love to hear from you.

Tags | ,

08

Jan
2013

No Comments

In Android

By Jay Dee

Android’s Fragmentation – Still A Problem For Android Developers

On 08, Jan 2013 | No Comments | In Android | By Jay Dee

android1Google’s Android possess a major flaw in its OS development, that is fragmentation issue. For this reason one android OS version still remains isolated from other android OS version. It offers a wide range of hardware and software options for the developers, which in turn increases time of development and causes complication for application design. From a latest survey of devices in the last two weeks, Google found that only 10% of android owners are running the latest version of the OS, and almost half (47%) are still using “Gingerbread” i.e. the version 2.33.

Android Developers have been challenged by Android’s open nature from the beginning. In addition, the release of OS updates to all the available hardware is dependent on a wide range of sources. For such reasons, Android developers have now targeted their Android application development for devices that run the Gingerbread platform and later, which is now on over 80% of Android devices.

Mobile Developers have faced even the worse fragmentation issues during the early days of development. With numerous hardware variants, developing app for a group of devices was almost impossible. With Android the fragmentation issue is more troublesome because of the advanced features which only a fraction of devices support it. This situation continuously drives the developers to focus on hardware specific abilities of the smartphones.

At Andolasoft we develop the most intriguing android mobile applications for individuals and from start-ups to established companies. We have team of experienced android developers who are skilled to develop innovative apps for all versions of android devices. Some of our apps showcased in the Google marketplace at:

https://play.google.com/store

/apps/details?id=com.andolasoft.christmasdemo&

feature=more_from_developer

Tags | ,

09

Jan
2013

No Comments

In Android

By Jay Dee

Android to be used in Consumer Electronic Appliances too

On 09, Jan 2013 | No Comments | In Android | By Jay Dee

android31Google’s Android operating system is the most widely used Smartphone operating system in the world. Besides that it is considered as the most user-friendly OS by the android users and has released it to other mobile device manufacturers.

But now Google has decided to power consumer home appliances with its android based software. These android applications will be developed specific to the instrument that will be embedded to its hardware.

Embedding Android directly into devices will make it easier for electronic appliances to exchange information with the humans. For example, android powered television can show a pop-up message from kitchen, indicating that the dish is ready to be served. The user could remotely access the kitchen appliances to turn it OFF or ON, from the TV. Google’s step is to bring the future imagination into reality. This will save a lot of time for the users and may avoid possible dangers. Like, if the device detects a gas leak in the kitchen it can automatically turn the appliance off or intimate the user about the situation. Devices will also be able to detect intrusions in the house when the user is not present.

Making such intelligent, connected appliances will need experienced android developers in the forefront. This advancement will also need advanced android application development for creating custom apps for the instruments. At Andolasoft we develop the most intriguing android applications for our customers. We have a pool of expertise android developers to provide innovative solutions for all versions of android operating software.

Tags | ,

28

Jan
2013

No Comments

In Android

By Jay Dee

Technology to run Android on Windows without emulation

On 28, Jan 2013 | No Comments | In Android | By Jay Dee

android31There are numerous operating systems available in the market such as windows, MacOSX, Linux etc. But there is no way to run Android OS natively on a computer. In order to carve this problem, advancements have been made to run Android on a windows system without a simulator. It will enable the Android operating system to run on ‘Windows’ kernel instead of its usual ‘Linux’ kernel. This system will detach the need of an emulation layer, therefore making the android OS performance ultra-fast.

Some of the first hand users said that this wasn’t the first application to run Android on windows but its ability to negate the use of emulation layer, is what makes it welcoming.

The system is currently believed to be working with Android 4.0 and could be installed on Windows 8, Windows 7 and Windows Vista. But in order to set-up the application, it would require a little android application development familiarity, more than the basic knowledge of using an android Smartphone. Once installed, it can be used like a native android OS on a computer. It will be enabled to run all kinds of android applications including the 3D games. This technology will bring new possibilities to run simulated environment on a different OS, without any hindrances.

At Andolasoft we develop the most intriguing android mobile applications for individuals and from start-ups to established companies. We’ve an expertise team of android application developers developing the most innovative apps for all android devices.

Tags | ,

27

Aug
2012

No Comments

In Android

By Jay Dee

Nexus 7: A Stepping Stone for Google Androids

On 27, Aug 2012 | No Comments | In Android | By Jay Dee

android-logo_in_device

Nexus 7, an android tablet and the first tablet in the Nexus Series has been launched on June, 2012 at the Google I/O conference. Google has developed the tablet in association with ASUS to give competition to similar devices developed by Amazon, Barnes and Nobles and Blackberry. The tablet is available to buyers through Google Play and taking orders for mid-July deliveries. The Nexus7 costs around $199 which is same as compared to Kindle Fire from Amazon or Nook Tablet from Barnes and Nobles.

As compared to the price, the tablet has got a lot of functionality to look for and as it is customizable, so it would give an edge to the developers. As of now android developers were developing apps for android phones and tablets like Galaxy, which are less of a competitor to iPad. But with launch of Nexus 7 and Jelly Bean as the new upgraded OS, Android application development industries would have the edge to develop apps for the real android brand Google with an android tablet users base. With great craftsmanship, the Nexus 7 has been designed well with a good front end which doesn’t hold to finger prints unlike iPad. The back side of the tablet is made up of rubber and nicely textured giving you feel of leather. It helps you to hold it in hand without any discomfort and it is much lighter as compared to Fire or Nook.

Nexus 7 has got a low resolution camera facing the user and can be used for video conferencing, but it doesn’t have a rear camera. What Asus explained to not having a rear camera in Nexus 7 is that including the rear camera in the tablet would increase the price point and also it lies unused after sometime. Nexus 7 is thinner, sleek and has got higher resolution compare to its competitors. It also has a microphone for audio conferencing which you will not find in Kindle Fire. Most importantly Nexus runs on Jelly Bean, the latest Android platform, having access to wide variety of apps around the web. Features like Google Play, Google Now and Voice Search makes you entertained all day long.

On hardware upgrades it has Bluetooth and GPS chips to help with data transfer and navigation respectively. The Home Screen is much more dynamic and customizable as compared to iPad. The performance of Nexus 7 is much faster with the help of feature Project Butter and the transitions among applications is lot easier. Nexus 7 has all the best features to beat its prey competitors on the battleground and it will surely be a stepping stone for Google in tablet development.

Andolasoft is a leader in providing android application development among the major custom software development companies around globe. We’ve experienced android developers and SMEs having expertise on JAVA and Android SDK. We’re using the latest Android frameworks and technologies to build simple and logical applications as per your requirements. Other than android we’ve expertise on Ruby on Rails, JAVA, PHP/CakPHP and iPhone application development.

Tags | ,

21

Feb
2013

No Comments

In Android

By Jay Dee

SwiftKey has unveiled its version 4 keyboard app for Android devices

On 21, Feb 2013 | No Comments | In Android | By Jay Dee

androidimg

To be completely honest, most android users are not satisfied with the android’s default keyboard. It can be fiddly for some users, who write languages other than English on a daily basis. After all it doesn’t cater to everyone’s typing style either. However “SwiftKey” has always proved to be the best keyboard app alternative for the android platform. This time the developers at SwiftKey have launched its version 4 for the android devices

One of the best features of this keyboard is its ability to gradually learn the user’s typing preferences. It studies how a user writes over time and generates predictive texts for him, which is surprisingly accurate and better than any other applications. SwiftKey has also included its swipe like feature called the SwiftKey Flow which lets the user type sentences without lifting finger from the mobile screen. SwiftKey now supports over 60 international languages.

Here are some of the most notable features in version 4 release:

  • SwiftKey Flow is a gesture typing feature that facilitates the users to write sentences simply by gliding over the keys. It also adds auto-correction ability as-well-as predicts the possible next words while typing.
  • It can also be blend with tap inputs and switching mid-word.
  • If the predicted word is correct then it can be inserted by simply lifting the finger off.
  • Flow through space lets the user type a complete sentence in one motion without lifting the finger, to give spaces between the words.
  • It supports word prediction for over 60 languages like Javanese, Sundanese, and Vietnamese etc with both auto-correction and word prediction abilities.
  • Easier correction and auto adaptability to users typing style.

According to reports Android application development with SwiftKey’s SDK now supports iOS, JVM, Linux, Mac OS-X, Windows, and C++ etc. SwiftKey had released its Flow feature in the last October and its Beta version was tested with a community of million users.  Being awarded numerous times for its keyboard application, it surely is one of the best android keyboard apps, plus it comes with a reasonable price.

Tags | ,

30

Aug
2012

No Comments

In Android

By Jay Dee

Why Android Shouldn’t get threatened from Windows 8

On 30, Aug 2012 | No Comments | In Android | By Jay Dee

android-logo_in_deviceMicrosoft has announced its upcoming OS Windows 8 on February 2012 which will be launched in the coming Fall. There are loads of features in Windows 8, but will it be a strong contender in the tablet or smartphone war? Android now covers 50-55 percentage of mobile and tablet markets around the world and most the custom software development companies choose android application development as their primary expertise. One of the great advantages of Android over Windows 8 is its open source, free and customizable. Let’s compare some of the key features of the above two and see as below.

Home Screen:

Home screen in both Android and Windows 8 are great with amazing dynamic icons and widget controls. Windows 8 placed icons and widgets in a more dynamic and usable manner, which is great for first-party apps. But when it come to third-party apps icons, justifying them is a lot harder. But in case of Android everything is customizable as the widgets can be re-sized, icons adjust themselves as per space on home screen and widgets show a lot information.

Browser Syncing:

Google provides the Chrome for Android, which has a great desktop sync including bookmark and search sync. Browser Sync is virtually absent with the Internet Explorer running on Windows 8.

App Market:

In the app Market there are around 600,000 apps based for android platforms whereas Windows based apps count only to 100,000 odd. It seems in the coming days it will be very difficult for Windows to catch up with android the way it grows. Most of the individual developers and custom software development companies are releasing apps based on android application development to the app stores offering a steep competition to windows.

Price Comparison of Tablets:

Manufacturers of Windows 8 tablets will have to use Windows 8 RT licenses costing around 90-100$ per device to build the devices which is a lot of money if compared to the free Android licensing. So the windows tablets will cost 30-40 percentage more than the Android tablets.

Apart from the above, Windows 8 lacks functionality in Voice Commands, Maps and Call Features as compared to Android. Even if Windows 8 have some advantages on Office Suites, Video Chatting, Wallets and user-friendliness, but it still has a long long way to go to level with the standards of Android.

Android Application Development is one of the major services offered by Andolasoft supported by experienced android developers who build the best apps as per your requirements. We work in an agile and collaborative environment to bring success to every project. We’ve developed apps based on restoration management, online to-do list services, rigging capacity tracking, baby vaccination tracking and on many other projects. Andolasoft provides android development in Corporate business applications, Multimedia and gaming applications, Web based applications and social networking applications for small start-ups and large businesses.

Tags | ,

06

Feb
2013

No Comments

In Android

By Jay Dee

Android 4.2.2 is set for release this month!

On 06, Feb 2013 | No Comments | In Android | By Jay Dee

androidimg

Google is constantly working to roll out its Jelly Bean update in the form of Android 4.2.2 in the end of this month. It is likely to be a minor update that will fix the prevalent bugs and to enhance the performance speed of the Jelly Bean OS. It is also expected to patch the Bluetooth streaming issue in Nexus 7 devices.

Some reports suggested that, Google is already testing the 4.2.2 update on all Nexus devices like the Nexus 4, Nexus7 and Nexus 10. According to the website, Google claims to release it to the consumers by mid-February. These rumors have been there for quite some time since the last couple of months but reporters have already spotted some Google Nexus 4 devices in Malaysia and Brazil that were running Android 4.2.2.

Rumors have it, that Google will be releasing its next Android version 5.0 in-between April and June of this year. This update may also be called as ‘Key Lime Pie’. Google has announced that its next developer conference will take place during May 15 to May 17 of 2013, where they might introduce new android applications for version 5.0. Finally, as only 1.2 % of Android devices run 4.2 Jelly Bean versions, only a few users would be benefited from this update.

At Andolasoft we develop the most intriguing android applications for our customers. We have a pool of expertise android developers to provide innovative solutions for all versions of android operating software.

Tags | , ,

09

Jul
2010

No Comments

In Android
Ipad

By Jay Dee

The Future of iPhone/Android Applications Development

On 09, Jul 2010 | No Comments | In Android, Ipad | By Jay Dee

iphoneandandroid_image

Due to its advanced and hi-tech features like multi-touch screen and easy operating features, both iPhone and Android based mobile apps have instantly attracted the smart phone users. iPhone developers have built a vertical hierarchy of layers of menu instead of typical check boxes and switches.

At Andolasoft we use cut-through techniques to deliver transparent and trustworthy mobile apps. We have steadily made our ways through development of stand-alone applications such as palmtop and have steadily made progress in windows based smart phones and PDAs like iPhone as well as Android based mobile apps development. Our developers are also specialized in cross-platform development in mobile apps. Our developers have their expertise in developing mobile apps on various platforms including iPhone, Android, Blackberry among others.

Utilizing the iPhone/Android application development, our experts have recently developed an interesting application through which you can give update about any upcoming events of your company. You can post your blogs, let your company delegates know of any recent projects undertaken- there are so many things you can do with our application. With this applications integrated with iPhone, you can showcase your successfully completed projects and keep your clients updated. What’s more, you can integrate this application with Google maps to utilize it as a roadmap for getting the location update.

Tags | , ,

13

Feb
2013

No Comments

In Android

By Jay Dee

Android 4.2.2 brings minor updates for the Nexus users with improvements in Bluetooth audio issue

On 13, Feb 2013 | No Comments | In Android | By Jay Dee

androidimg

Android’s latest 4.2.2 update is already released and beginning to roll out for its Nexus devices. This update will late be availed to other Mobile devices too. Since its last update i.e. Android 4.2.1 during the late November, 4.2.2 appears to have minor fixes only.

Android 4.2.2 update has primarily resolved the issue of audio streaming over Bluetooth that used to skip during the operation. Reddit user WeeManFoo quoted “Bluetooth streaming works better (compared to 4.2.1) but it’s not perfect” and mentioned that for other notable fixes or features to 4.2.2, users might have to wait for an official changelog.

WeeManFoo also referred that his Galaxy Nexus still gets disconnected from Bluetooth speakers when switching from Wi-Fi to a 3G data connection. So, it appears that there is still some work to be done by the android developers.

Google has also modified the new ‘Quick Settings panel’ introduced in Android 4.2.2. The Wi-Fi and Bluetooth icons in the panel can now be turned OFF and ON by long-pressing the icons, instead of browsing to their respective settings panels.

Google has also introduced a notification sound for wireless charging and has changed the notification sound that indicates that the phone or tablet’s battery is running low.

None of these are major changes, but they sure bring the refinements that we expect from a minor update. Android 4.2.2 continues to roll out to Galaxy Nexus, Nexus 7, and Nexus 10 devices however Nexus 4 users will have to wait for now.

At Andolasoft we develop unique android mobile applications for individuals and from start-ups to established companies. We’ve an expertise team of android app developers who design the most innovative apps for all android devices.

Tags | ,

22

Jan
2014

No Comments

In Android

By Jay Dee

What’s new in Android 4.4 ‘KitKat’ for Developers

On 22, Jan 2014 | No Comments | In Android | By Jay Dee

Google released the latest version of Android (version 4.4), known as KitKat on 31st Oct 2013. It is designed to work on a wide variety of devices. The new version of Android has got a lot of exciting features for both users and developers.

 

KitKat

Some of the new features in the latest version of Android for developers to learn and explore are:

Screen Recording

The screen recording feature of Android 4.4 lets you capture video of your app and save it as an MP4 file. The recording can done at any device-supported resolution and then shared directly from the device to a computer for post-production.

Full Screen Immersive Mode

Full-screen immersive mode in KitKat allows any app to go truly full-screen, hiding both the navigation and status bars and takes advantage of every last pixel on the screen of a smartphone or tablet. You simply need to do a swipe from the top or bottom of the screen, in order to display the system bars again. Basically, developers can hide the entire system’s interface while the user is engaged in their apps(like e-reader and other media apps and games).

Scene Transitions

Android 4.4’s new transitions framework allows app developers to define how one screen animate to another scene. Developers can use predefined transition types called TransitionManager that animate the properties that matters the most to your app.

Storage Access Framework

With the release of Android 4.4 KitKat, users now have a smoother way of accessing and creating documents in an app from a variety of cloud storage providers. Developers can add their own storage devices to Android without having to do it on a specific vendor by vendor basis.

New WebView & Chromium Features

KitKat includes new implementation of WebView based on Chrome for Android 3.0. It allows developers to use the latest compatibility features, performance standards and support in WebView to access their Web-based content. Chromium WebView supports many aspects of HTML5 as well as CSS3 and JavaScript.

New Near Field Communications Platform Support

One of the new features in Android 4.4 is Host Card Emulation (HCE) to support Near Field Communications (NFC) transactions. Apps can also act in a new “Reader Mode” to receive NFC functionality (like payment processing, building access, tickets etc.) as it uses an Application Identifier (AID) to route the different NFC function from the hardware in a device to the app.

Low-Power Sensors

Android 4.4 support for hardware sensor batching, a new optimization that can dramatically reduce power consumed by ongoing sensor activities. It can makes your app more efficient and it lets you track sensor events continuously.

RenderScript Takes Advantage of Device Hardware

RenderScript can now be accessed in kitkat 4.4 by a new C++ api in the android native developer kit. High hardware consuming tasks can now be integrated into an apps native code and it allow for support from multiple smartphone CPU and GPU cores.

Andolasoft has a team of experienced android developers who are skilled to develop innovative apps for all versions of android devices. We have developed Android Apps like KurrentJobs, EstateMobz and many more.

Tags | , ,

27

Jun
2013

No Comments

In Android

By Meera M.

How to show Captured Images dynamically in “GridView” Layout

On 27, Jun 2013 | No Comments | In Android | By Meera M.

gridview_sample-253x300

There are numerous camera apps in the market which displays shopping items (i.e. image view). In these camera apps we need to arrange each photo items in a list view, basically a ‘GridView’. In such cases, ‘table layout’ would be easier to use; but it is difficult to arrange large number of items in side scroll view. As ‘table view’ is just a layout manager, it doesn’t allow direct interaction with each item to the users.

In order to tackle such development issues, it would be smart to implement ‘GridView’ Layout.

What is “GridView” Layout?

GridView (android.widget.GridView) is a layout that is implemented to show two-dimensional view with scrollable structure. With the help of ‘List’ adapter, we can add images dynamically to a ‘GridView’ layout by customizing the number of columns.

Example of Layout xml

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
tools:context=".MainActivity" >

<RelativeLayout
android:id="@+id/RelativeGridLayout"
android:layout_width="wrap_content"
android:layout_height="fill_parent" >

<GridView
android:id="@+id/gridviewimg"
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:gravity="center"
android:numColumns="2"
android:scrollbarStyle="outsideInset"
android:smoothScrollbar="true"
android:verticalSpacing="10dp"
android:paddingBottom="50dp"
android:paddingTop="10dp"
/>
</RelativeLayout>

<RelativeLayout
android:id="@+id/RelativeLayout01"
android:layout_width="fill_parent"
android:layout_height="40dp"
android:layout_alignBottom="@+id/RelativeGridLayout"
>

<Button
android:id="@+id/capture_btn1"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:text="Camera" />
</RelativeLayout>

</RelativeLayout>

Example of Main form Activity class

1.MainActivity.java

package com.example.gridviewimagesdemo;

import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Date;
import java.util.List;

import android.net.Uri;
import android.os.Bundle;
import android.os.Environment;
import android.provider.MediaStore;
import android.app.Activity;
import android.content.ActivityNotFoundException;
import android.content.Context;
import android.content.Intent;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.util.Log;
import android.view.Menu;
import android.view.View;
import android.view.ViewGroup;
import android.view.View.OnClickListener;
import android.widget.BaseAdapter;
import android.widget.Button;
import android.widget.GridView;
import android.widget.ImageView;
import android.widget.Toast;

public class MainActivity extends Activity implements OnClickListener {

Button captureBtn = null;
final int CAMERA_CAPTURE = 1;
private Uri picUri;
private DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
private GridView grid;
private  List<String> listOfImagesPath;

public static final String GridViewDemo_ImagePath = Environment.getExternalStorageDirectory().getAbsolutePath() + "/GridViewDemo/";

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);

captureBtn = (Button)findViewById(R.id.capture_btn1);
captureBtn.setOnClickListener(this);
grid = ( GridView) findViewById(R.id.gridviewimg);

listOfImagesPath = null;
listOfImagesPath = RetriveCapturedImagePath();
if(listOfImagesPath!=null){
grid.setAdapter(new ImageListAdapter(this,listOfImagesPath));
}
}

@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.main, menu);
return true;
}

@Override
public void onClick(View arg0) {
// TODO Auto-generated method stub
if (arg0.getId() == R.id.capture_btn1) {

try {
//use standard intent to capture an image
Intent captureIntent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
//we will handle the returned data in onActivityResult
startActivityForResult(captureIntent, CAMERA_CAPTURE);
} catch(ActivityNotFoundException anfe){
//display an error message
String errorMessage = "Whoops - your device doesn't support capturing images!";
Toast toast = Toast.makeText(this, errorMessage, Toast.LENGTH_SHORT);
toast.show();
}
}

}

protected void onActivityResult(int requestCode, int resultCode, Intent data) {
if (resultCode == RESULT_OK) {
//user is returning from capturing an image using the camera
if(requestCode == CAMERA_CAPTURE){
Bundle extras = data.getExtras();
Bitmap thePic = extras.getParcelable("data");
String imgcurTime = dateFormat.format(new Date());
File imageDirectory = new File(GridViewDemo_ImagePath);
imageDirectory.mkdirs();
String _path = GridViewDemo_ImagePath + imgcurTime+".jpg";
try {
FileOutputStream out = new FileOutputStream(_path);
thePic.compress(Bitmap.CompressFormat.JPEG, 90, out);
out.close();
} catch (FileNotFoundException e) {
e.getMessage();
} catch (IOException e) {
e.printStackTrace();
}
listOfImagesPath = null;
listOfImagesPath = RetriveCapturedImagePath();
if(listOfImagesPath!=null){
grid.setAdapter(new ImageListAdapter(this,listOfImagesPath));
}
}
}
}

private List<String> RetriveCapturedImagePath() {
List<String> tFileList = new ArrayList<String>();
File f = new File(GridViewDemo_ImagePath);
if (f.exists()) {
File[] files=f.listFiles();
Arrays.sort(files);

for(int i=0; i<files.length; i++){
File file = files[i];
if(file.isDirectory())
continue;
tFileList.add(file.getPath());
}
}
return tFileList;
}

public class ImageListAdapter extends BaseAdapter
{
private Context context;
private List<String> imgPic;
public ImageListAdapter(Context c, List<String> thePic)
{
context = c;
imgPic = thePic;
}
public int getCount() {
if(imgPic != null)
return imgPic.size();
else
return 0;
}

//---returns the ID of an item---
public Object getItem(int position) {
return position;
}

public long getItemId(int position) {
return position;
}

//---returns an ImageView view---
public View getView(int position, View convertView, ViewGroup parent)
{
ImageView imageView;
BitmapFactory.Options bfOptions=new BitmapFactory.Options();
bfOptions.inDither=false;                     //Disable Dithering mode
bfOptions.inPurgeable=true;                   //Tell to gc that whether it needs free memory, the Bitmap can be cleared
bfOptions.inInputShareable=true;              //Which kind of reference will be used to recover the Bitmap data after being clear, when it will be used in the future
bfOptions.inTempStorage=new byte[32 * 1024];
if (convertView == null) {
imageView = new ImageView(context);
imageView.setLayoutParams(new GridView.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT));
imageView.setPadding(0, 0, 0, 0);
} else {
imageView = (ImageView) convertView;
}
FileInputStream fs = null;
Bitmap bm;
try {
fs = new FileInputStream(new File(imgPic.get(position).toString()));

if(fs!=null) {
bm=BitmapFactory.decodeFileDescriptor(fs.getFD(), null, bfOptions);
imageView.setImageBitmap(bm);
imageView.setId(position);
imageView.setLayoutParams(new GridView.LayoutParams(200, 160));
}
} catch (IOException e) {
e.printStackTrace();
} finally{
if(fs!=null) {
try {
fs.close();
} catch (IOException e) {
e.printStackTrace();
}
}
}
return imageView;
}
}
}

Example of Manifest.xml file content:

Example of AndroidManifest.xml

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.gridviewimagesdemo"
android:versionCode="1"
android:versionName="1.0" >

<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="17" />

<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />

<application
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<activity
android:name="com.example.gridviewimagesdemo.MainActivity"
android:label="@string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />

<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>

</manifest>

Conclusion:

So, a ‘Grid view’ implementation would result in following features and benefits:

  • In ‘GridView’ layout items would be listed in a static grid, defined in layout xml file.
  • ‘Gridview’ extends android.widget.Adapter, so it could be used where large amount of data is managed in a single page frame.
  • Enhanced data source binding capabilities (Direct interaction with SQLite Data Source)
  • Built-in support for sorting and paging mechanism
  • Additional Column types (ImageField)

Recommended Reading: Display Images in GridView on iPhone

I hope you find this useful. If you want to develop android or mobile application  for you or for your organization, then you can hire single or group of developers from the pool of skilled and accomplished android specialists. Drop me a line below with your thoughts, thanks.

Tags |

09

May
2014

No Comments

In Android

By Meera M.

How to monetize your Android application through In-App Billing?

On 09, May 2014 | No Comments | In Android | By Meera M.

In-App-Billing1What is In-app Billing ?

In-app products are the digital goods that you offer for sale from inside your Android application to your app users. You cannot use In-app Billing to sell personal services, physical goods, or anything that requires physical delivery.

Product types

The Version 3 API supports managed in-app products and subscriptions to give you flexibility in how you monetize your application. You can specify these types of products by using the Google Play Developer Console.

  • Managed in-app products:
    When a managed in-app item is purchased by an user, Google Play stores the purchase information for each item on a per-user basis.
  • Subscriptions :
    In In-app Billing, subscription plan offered you to sell content, services, or features to users from inside your app with recurring monthly or annual billing.

I will demonstrate a small example with In-app Billing,

To implement in app billing in your android project follow the below steps:

Step# 1: Installing the Google Play Billing Library
Before proceeding, verify you have installed the library by launching the Android SDK Manager by selecting the Eclipse Window -> Android SDK Manager option. Once loaded SDK Manager, scroll down to the Extras section and the Status column next to the Google Play Billing Library
Step# 2: Adding Billing Permission to the Manifest File
Add the following line in your AndroidManifest.xml file in order to make your app eligible to use in-App billing.

<uses-permission android:name=”com.android.vending.BILLING” />
Step# 3: Adding the Utility Classes to the Project
Find out the “TrivialDrive” sample project that was installed into the android SDK as part of the Google Play Billing library, includes a set of classes intended specifically for in-app billing implementation.

Locate the IInAppBillingService.aidl file in “TrivialDrive” sample project and add it to the package named “com.android.vending.billing”.

Then Select all nine Java files within “com.example.android.trivialdrivesample.util” package and copy and paste them into the <domainname>.inappbilling.util package of your InAppBilling project.

Step# 4: Designing the User Interface
Design your UI according to your need. This is a sample design developed to demonstrate the In-App Billing.

In-App-Billing-181x300

 

 

 

 

 

 

 

 

 

Step# 5: Obtaining the Public License Key for the App
Google Play billing must be identified by a unique public license key. The only way to get a public license key is to register an application within the Google Play.
Go to http://play.google.com/apps/publish Once you are logged in, In home page of the Google Play Developer Console, click the Add new application button, which specifying the default language and a title of InAppBilling. Once the above information has been entered, click the Upload APK button:
This APK file upload is not necessary at this point, so once the application has been registered, click on the Services & APIs option to display the Base64-encoded RSA public key for the application.

Step# 6: Creating a New In-app Product
Select the In-app Products menu item from the left hand panel of the developer console.To add a new product, click on Add new product button and, in the result panel, set the product type to Managed product and enter a Product ID (in this case com.andolasoft.testInApp). Click on Continue and in the second screen By entering a title, description and price for the item. Change on the menu at the top of the page to Activate.

Step# 7: Implementing “Purchase” Button click

public class MainActivity extends Activity {
 
    private static final String TAG = "<your domain>.inappbilling";
    IabHelper mHelper;
     
    private Button clickButton;
    private Button buyButton;
    private static final String TAG = "com.andolasoft.testInApp";
    IabHelper mHelper;
    static final String ITEM_SKU = "android.test.purchased";
.    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
 
        buyButton = (Button)findViewById(R.id.buyButton);
         
        String base64EncodedPublicKey =
                                       "<your license key here>";
         
            mHelper = new IabHelper(this, base64EncodedPublicKey);
         
            mHelper.startSetup(new
            IabHelper.OnIabSetupFinishedListener() {
                    public void onIabSetupFinished(IabResult result)
             {
                       if (!result.isSuccess()) {
                         Log.d(TAG, "In-app Billing setup failed: " +
                    result);
                       } else {             
                           Log.d(TAG, "In-app Billing is set up OK");
                              }
                      }
            });
    }
public void buyClick(View view) {
             mHelper.launchPurchaseFlow(this, ITEM_SKU, 10001,   
                    mPurchaseFinishedListener, "mypurchasetoken");
/*The developer payload token string. This can be any string value and is used to identify the purchase. For the purposes of this example, this is set to “mypurchasetoken”.*/
 
    }
@Override
protected void onActivityResult(int requestCode, int resultCode,
     Intent data)
{
      if (!mHelper.handleActivityResult(requestCode,
              resultCode, data)) {     
        super.onActivityResult(requestCode, resultCode, data);
      }
}
IabHelper.OnIabPurchaseFinishedListener mPurchaseFinishedListener
    = new IabHelper.OnIabPurchaseFinishedListener() {
    public void onIabPurchaseFinished(IabResult result,
                    Purchase purchase)
    {
       if (result.isFailure()) {
          // Handle error
          return;
     }      
     else if (purchase.getSku().equals(ITEM_SKU)) {
         consumeItem();
        buyButton.setEnabled(false);
    }
           
   }
};
public void consumeItem() {
    mHelper.queryInventoryAsync(mReceivedInventoryListener);
}
     
IabHelper.QueryInventoryFinishedListener mReceivedInventoryListener
   = new IabHelper.QueryInventoryFinishedListener() {
       public void onQueryInventoryFinished(IabResult result,
          Inventory inventory) {
 
                       
          if (result.isFailure()) {
          // Handle failure
          } else {
                 mHelper.consumeAsync(inventory.getPurchase(ITEM_SKU),
            mConsumeFinishedListener);
          }
    }
};
IabHelper.OnConsumeFinishedListener mConsumeFinishedListener =
      new IabHelper.OnConsumeFinishedListener() {
       public void onConsumeFinished(Purchase purchase,
             IabResult result) {
 
     if (result.isSuccess()) {                
            //Here user paid for the app so write your logic to show the content to user
     } else {
             // handle error
     }
  }
};
 
@Override
public void onDestroy() {
    super.onDestroy();
    if (mHelper != null) mHelper.dispose();
    mHelper = null;
}
 
}

Step#8 : Upload the “APK”
Create the signed APK of your project and upload it in your added Application in Google Play Developer Console

Step# 9: Adding In-app Billing Test Accounts
Unfortunately, Google does not allow developers to make test purchases from their own Google accounts app billing, Other Google accounts used as testing accounts. . From ths ipoint on, in order to test in-app,  the users of these Google accounts must load your application onto their devices and make test purchases. To add a test user account, click Settings icon located on the left hand side of your Google Play Developer Console home screen and on the account details screen scroll down to the License Testing section. In the corresponding text box, give the Gmail accounts for the users who will be performing the in-app testing on your behalf before saving the changes.

Note: This email Id should be the primary account of an android device where this app is to be tested. Check with Google policy before publishing the app to the android market place.

Conclusion: I hope you find this post useful to sell your android in-app products and services, make transaction smoother and easier, and improve your revenue. If you are looking for any assistance regarding android application development or other android integration, then you can contact us.

See Also: How to monetize your iOS app through Apple In-App Purchase integration

Like this blog? I’d love to hear about your thoughts on this. Thanks for sharing your comments.

 

Tags | , ,

31

Oct
2014

No Comments

In Android

By Jay Dee

What’s new in Android L, Windows 8.1 and iOS 8

On 31, Oct 2014 | No Comments | In Android | By Jay Dee

As all the three major mobile players in smartphone categories  i.e. Apple, Google and Microsoft come up with their latest version of Operating Systems i.e. iOS 8, Android L & Windows 8.1 respectively. Let’s have a look how it is worthy for users to switch over the most-recent OS version based upon the new features.

Android-L-Windows-8-iOS-8

Android L:-

  • Personalized unlocking features, which make your smartphone or tablet search for familiar Bluetooth’s gadgets, Wi-Fi networks, locations and even voice imprints to deactivate any lock screen protections, letting you jump straight into your phone when it knows you’re nearby. If the device can’t detect any of this metrics, anyone trying to use it will be presented with the standard lock screen.
  • Google is focusing on its stock android keyboard for Android 5.0 Lollipop for adding more personalized and scrapping the individual tiled keys.
  • There is one more exciting feature i.e. “Do Not Disturb mode”, which automatically deactivates all notifications and audio during set times, support for Bluetooth 4.1 and a completely redesigned audio back end with support for USB audio devices.
  • Also Android L is going to introduce 64-bit processor support and  improving battery life with Project Volta. Project Volta includes a new battery historian which will help users work out what a device was doing at any given point in a battery cycle to find out which apps are draining the most power.

Windows 8.1 :–

Microsoft has already rolled out windows 8.1 few months back. Some of the features that were added windows phone 8.1:

  • Cortana, which is very much similar to Siri in iOS device, act as your personal assistant. Cortana notebook features store things that you tell her about yourself and also keep tracks what you like and what you’d like done. It can access apps, set alarms, send messages to specific persons, post a Facebook status, add a tweet, search for something and a lot more.
  • The action center which is finally added, and here you can get all your notifications and other controls such as setting Bluetooth, and Wi-Fi.
  • Another interesting feature that added to windows 8.1 was Quiet Hours. Here You can set what time you want your phone to be “quiet,” shutting out noise or notifications coming from it.

There is some other new features like setting up your personal photos as the background on the said start screen, connects you to free Wi-Fi hotspots near you through Wi-Fi sense, transferring files from the internal memory and SD-card seamless through Storage Sence etc.

iOS 8:-

iOS 8 also launched with lots of new features and here I am going to share few of them:

  • iPhone has new feature “Send Last Location” which allows your iPhone (or iPad) to send its last-known location to Apple when the battery drains to a critical level. If you lost your device, it will help you to find the last location of your device even if it’s battery is completely drained.
  • You can now include photos when making notes, to-do lists and reminders in Apple’s iOS 8 notes app.
  • Now iPhone can identify the song due to Shazam integration in Siri. If you ask Siri, “What song is playing?”, it will cause her to listen to the ambient sound, using Shazam to identify music.
  • You can notice iOS 8 has new keyboard with a very smooth predictive type features, which suggests three words right above the keyboard.

I hope you liked this post. What you would like to prefer- Android L, iOS 8 or windows 8.1 and why. Please share your answer in the below comment section

Recommended Blog: Useful features of iOS 7

Looking to make your mobile application dreams come true? Contact us today to make it a reality.

Tags | , ,