--ADVERTISEMENT--

In android, you can easily download any files or images from internet/URL. There are many ways to download images from internet and in this tutorial you will learn one of the easiest ways to download image from internet. Showing download progress derives a good user experience. So in this tutorial, you will also learn to display a progress bar that runs when the app downloads an image or files from the web.

Once the image is completely downloaded, the progress bar is disabled and the downloaded image is shown in an image view.

Related:
Load Image from URL (Internet) in Android
How to Pick an Image From SD Card Gallery and Display in Android App
Display Images in Android GridView

Creating New Android Project

Downloading File or Image and Displaying in Android

Let’s start by creating new android project with com.viralandroid.androiddownloadingfile package name and Android Downloading File as project name.

XML Layout File

Open your main XML layout file and add a button to download file or image when button is clicked. And also add an ImageView to show downloaded image. Don’t forget to give an id to both Button and ImageView. Your XML layout file will look like below.

res/layout/activity_main.xml


Java Activity File

In main activity class, you need to implement necessary classes and buttons. Progress dialog can be shown using ProgressDialog class which is a subclass of normal AlertDialog class.

Also you need to add Async background thread to download file from web/URL. Add asynctask class and name it as DownloadFromURL and extend AsyncTask in your main activity.

After downloading image from internet, read the downloaded image from the sdcard and display it in an image view.

Following is the complete code of java activity file.

src/MainActivity.java


Adding Internet and Writing to SdCard Permission

Before running your project, open your AndroidManifest.xml file and add android.permission.INTERNET and android.permission.WRITE_EXTERNAL_STORAGE. Your AndroidManifest.xml file will look like below.

Downloading File or Image and Displaying in AndroidDownloading File or Image and Displaying in Android



AndroidManifest.xml


Now, run your app by clicking Run button. Make sure you have internet connection to download image or file from web URL. Click the download button; you will see the progress bar with download progress in percentage. After download is completed, the downloaded image is shown in the ImageView, below the download button.

Android allows you to connect your android app to facebook. You can connect your app to facebook and share data or any other updates on facebook. By connecting app to facebook you can use facebook login, account kit, share and send dialog, app event, graph API, etc. In this tutorial you will learn to integrate facebook in android app using Android Studio and add login using facebook SDK.

The Facebook SDK is very easy to integrate in your Android app with Facebook. There are two different ways to integrate facebook and share something from your app – Facebook SDK and Intent Share.

Releted:
Integrating Google Firebase Analytics to your Android Project
How to Integrate Google AdMob in Android
Google Maps Android API Getting Started Tutorial : Part 1

Android Example: Integration Facebook Login in Android Using Android Studio


Let’s start by creating new android project using Android Studio or you can use any other development environment like eclipse to integrate facebook login in android app/game. Create new project with project name: Facebook Integration Android and minimum API 15: Android 4.0.3.

Facebook Integration in Android - Facebook Login


Create New Facebook App


Open facebook developer site developers.facebook.com . Open MyApp tab and click on the Add a New App. Here you need to fill up app information like name, contact email, app category etc. and click Create App Id button.


In Product Setup (Add Product) page click Facebook Login Get Started button. Enable Client OAuth Login, Web OAuth Login, Embedded Browser OAuth Login, Force Web OAuth Reauthentication and click Save Changes button.

From fb app dashboard click Choose Platform button and select Android.


Generate Android Hash Key


Now you need to get key hash value for your app. The key hash value is used by facebook as security check for login. To get hash key for your app, follow the following steps:

1. Open command prompt (Terminal)
2. Run the following command:
keytool -exportcert -alias androiddebugkey -keystore C:\Program Files\Java\jdk1.8.0_25\bin\debug.keystore | C:\OpenSSL\bin\openssl sha1 -binary | C:\OpenSSL\bin\openssl base64

Make sure you have installed jdk and OpenSSL in your PC and replace C:\Program Files\Java\jdk1.8.0_25\bin with your jdk bin directory and C:\OpenSSL\bin with your OpenSSL bin directory.


Now you will get hash key something like 2jmj7w0yVb/vlkK/YBwk= copy it.

Go to facebook developer page and select your app. From setting section click Add Platform and choose Android.

Here you need to provide more information about app like app package name, class name, hash key that we have generated above and so on. Add these information, enable Single Sign On and click Save Changes button.

Google Play Package Name: com.viralandroid.facebookandroidintegration
Class Name: com.viralandroid.facebookandroidintegration.MainActivity
Key Hashes: 2jmj7w0yVb/vlkK/YBwk=

From App Review section enable Make Android Integration public.

Add Repositories and Compile Dependency


Open module build.gradle file from android studio. Add repositories {mavenCentral()} and compile 'com.facebook.android:facebook-android-sdk:[4,5)' as dependency and build your project. Build.gradle file will look like below.
Module:build.gradle


Add Facebook App ID


Open your app strings.xml file, /app/src/main/res/values/strings.xml. Add a new string with the name facebook_app_id containing the value of your Facebook App ID. Strings.xml file will look like below.

res/values/strings.xml


Update your Android Manifest File


Open AnddroidManifest.xml file and add a user-permission and meta-data element. Android manifest file will look like this.

AndroidManifest.xml


Android XML Layout File


Open activity_main.xml file and add a TextView and facebook LoginButton widget. This XML layout file will look like this.

res/layout/activity_main.xml



Modify Java Activity File


In your java activity file, add callbackManager and onActivityResult. Following is the complete content of java activity file.

src/MainActivity.java


Now run your application by clicking Run icon from toolbar. Make sure you have connected your android device with computer and internet. Above are the screenshots of this example project.

JSON stand for JavaScript Object Notation. It is a minimal, readable, format for structuring data. JSON is an independent data transmit between a server and application and is the best alternative for XML. It represents data in a text format so that can be easily parsed. In this android JSON data parsing tutorial you will learn to parse the response in order to get the required information in android app.

Android provide different classes to manipulate JSON data, they are JSONArray, JSONStringer, JSONObject and JSONTokenizer. An JSON file have many components like Array([), Objects({), Key and Value.

Related:
Android Push Notification Tutorial Using Firebase
YouTube Android API Integration: Getting Started with YouTube Android API
Turn ON and OFF WiFi Connection Programmatically in Android


JSON Parsing Android Tutorial with Example


Let’s create new android project called Android JSON Data Parsing Example to parse JSON data from web server to android app.

Android JSON Data Parsing Tutorial with Example

Following is the simple JSON data that we parse in android app. This JSON gives list of contact information.


This JSON data can be found at: https://api.myjson.com/bins/31b8v

Adding Internet Permission


We are getting JSON data from server, so we need to add internet permission in our project AndroidManifest.xml file. Just open AndroidManifest.xml file and add android.permission.INTERNET permission. AndroidManifest.xml file will looks like below.

AndroidManifest.xml


XML Layout File


Open your activity_main.xml file and add ListView with an id to display JSON data in list view. Following is the content of activity_main.xml file.
res/activity_main.xml


Again create a new XML layout file list_item.xml and add three TextView vertically with id, textColor, textStyle, textSize, etc. Following is the complete content of list_item.xml file.
res/list_item.xml


Http Handler Class


Create a new java class HttpHandler.java and add the following java code.
src/HttpHandler.java


Modify MainActivity.java File


Open your MainActivity.java file and replace it with following code.
src/MainActivity.java


Now run your application, which looks like above screenshot. After running your app, you will see name, email address, and phone number in ListView. You can change these information according to your requirement. Remember to turn on the Internet connection on your device either WiFi or mobile data, because we have loading JSON data from internet.

To rule the digital market, you need to come up with a robust, scalable and feature-rich mobile application which should be compatible with Android and iOS. The reason you should develop an app compatible with these two platforms is because they both have a huge user base and will offer a proper market for your app.

The Android and iOS operating systems have their pros and cons but in this post, we won't be discussing Android application development services or iOS development. Here you will be reading about few app development tools that will come in handy while building an innovative application. It will be good that you create an app that functions on both the platforms as it will not only help you in earn good amount of users but will also fetch you several monetary benefits.

Related:
5 Questions to Ask Before Hiring Mobile App Developers
Integrating Google Firebase Analytics to your Android Project
Android App Security is Enhanced on Google Play Reveals

Given below are the few useful tools that will help you create a fully-functional mobile app:

Shoutem

Shoutem

Launched in the year 2011, this app maker is quite refined compared to the other software. Shoutem comes loaded with plenty of powerful development options such as smooth image integration and adding location-based directory which helps in building different apps that use geographical locations and photos.

Apart from that, Shoutem also helps Android apps developer to add different monetization elements like advertising support, integration of Shopify etc. As it's a paid software so the pricing starts from $19 for the basic version and if you wish to publish your app on Google Play or Apple's App store then you need to pay $49 for the advanced plan.


AppYourself

AppYourself

With this, you can develop apps compatible with iOS, Windows Phone OS, Android. You can also use it for creating pure HTML5 apps. Apart from being feature-rich this software also allows developers to build a responsive website which can be synced with the app content. Right now, this feature is in the beta phase, and the company promised to launch the full version soon.

AppYourself comes with four pricing tiers: The Web Only- €5, Basic- €15, Premium- €30 and the Enterprise Version that has a price tag of €50 & €200 and also offers a free setup. Well, you can use this software for as long as you want but to publish your app you need to purchase one of their premium

Mobile Roadie

Mobile Roadie

This app maker is one of the big players in the market. It is used for building robust enterprise apps and companies like Disney, TED.org, Cirque Du Soleil and Universal Studios got their apps developed using this software. Coming at the price point the Core version of Mobile Roadie has a price tag of $149 and the Pro version has a hefty price of $799.

As this software focuses on larger companies so small or part-time app developers don't use it much. Mobile Roadie offers great templates and gives several options to tweak them as per the requirements. Moreover, there's a huge support community where you can get in touch with other developers or designers using this app builder.


Mobincube

Mobincube

Compared to Mobile Roadie, the Mobincube positions itself as the website builder which can be used by everyone. This software comes with an Admob platform that assists in running adverts in the app. Mobincube is quite affordable and a developer has to pay $9.99 for the basic version. Another good thing about their plans is that it allows developers to go native or they can publish their app on any app store.

Mobincube is still in development phase, so you might face few technical issues or bugs while using the editor. From simple to complex, a developer can create any page type using this software. After some recent changes, you can now add HTML modules, user account registration screens, advanced forms, embedded HTML5 games and much more.

MobAppCreator

MobAppCreator

It is a newly launched software and mainly focuses on building native apps i.e. apps which can only be published on one platform. The developers of this software claim to have almost 41,000,000 apps views and rising. There are not many pre-designed templates in the app builder but the editor is very user-friendly, offers a simple interface and no technical jargons are involved.
MobAppCreator comes with a 14-day trial version which offers proper access to all the tools. The cheapest plan starts at $32.50 per month and it comes with few additional templates. And they have their own separate online store module available for the South American market.

GoodBarber

GoodBarber

This app builder comes loaded with beautiful themes and amazing features like social networking, iBeacons, Geofencing, chat system, etc. With GoodBarber you can get your native iOS and Android app developed at just €16 per month. There's an extensive showcase of apps which were developed using this software.

Apart from that, a user can also integrate different eCommerce features like Amazon, Shopify and Etsy. Their app editor is easy to use and even an amateur developer can use it to create a basic app. The only drawback of this system is they don't have their own online store.

Como DIY

Como DIY


This app maker claims that it has been used to build around 1 million apps which make it another big player in the market. They offer a spectrum of app building blocks like loyalty card feature, user reviews, events, appointment scheduling and eCommerce. Most of the restaurants, bands and museums use this software to developer their apps. It has seven unique templates that can be combined with six navigational styles.

Como DIY recently updated their pricing structure: now there is only one pricing tier which is $57 monthly, $48 yearly and $41 bi-yearly. Along with cost-effective prices, they also offer a 6-month "Success Guarantee plan" which means that Como DIY will give you six months for free if you are not able to achieve any profitable or meaningful business results with the app developed using this platform.


Wrapping Up

In this post, you will come across seven best app building software's that will surely make your app development process hassle-free. This is true that you don't need to an expert in scripting languages however if you actually want your app to get published on Android or iOS app store then you will be needing a basic coding & image editing skills. High quality graphics, features and functionalities are some of the key components that enhance the user base of an app.

Author Bio:
Xicom Technologies Ltd, is an USA based, Software and mobile application development company. We have 350+ experts who are available on the full-time, part-time and hourly basis. You can hire their developers at just $25 per hour.

Android application or game package name is very important for developer, because the package name serves as a unique identifier for the application and also unique in Google Play Store. Once you purchase application project with source code you need to change the package name of the application. The package name defines your application’s identity. But once you published your application in the market place, you cannot change the package name. If you change it, then it become new application in the play store (market place) and users of previous version cannot update to the new version.

In this tutorial you will learn to change or rename the package name of your android app from android studio. There are different ways to change package name in android studio and you will learn here. Renaming the package name on android studio is not much difficult. But also this article teaches you to change package name on android studio step by step, you can also follow similar ways in eclipse too.

Related:
How to Add a Library Project to Android Studio
Building First Android Application with Android Studio (Hello World Example)
How to Take Screenshot of Android Application in Android Emulator and Real Device from Android Studio
How to Remove/Delete Android Project from Android Studio

How to Change or Rename Package Name in Android Studio


Following are the steps to rename package name in android studio. If you want to change com.example.oldapp to com.example.newapp , then;

Renaming Package Name: Method 1


1. Create new package name in java directory

Go to java directory of your project (app or mobile/src/main/java), right click on that java directory > New > Package, enter your app new package (com.example.newapp) and confirm.

Rename or Change Package Name in Android Studio

2. Add Packages and Classes in New Package

Go to old package name (com.example.oldapp) select all packages and classes of old package name and copy and paste in to the new package (com.example.newapp). And click on Refactor button and then click Do Refactor.

3. Delete Old Package Name

Now you can delete old package name (com.example.oldapp).

4. Change Package Name in AndroidManifest.xml File

Open AndroidManifest.xml file and change all old package name with new one. (Change com.example.oldapp with com.example.newapp). Now clean the project top menu > Build > Clean Project.

5. Replace in Path

Right click on app/mobile directory > Replace in Path > set old package name and new package name, Case sensitive to true > Find > Replace > All Files. And again clean your project (top menu > build > clean project).

6. Synchronize Project

Go to top menu > tools > android > Sync Project with Gradle Files.


Renaming Package Name: Method 2


Rename or Change Package Name in Android Studio

1. Open project directory from left side.

2. Go to App Name/app/build/generated/source/r/debug/com/your old package without com. (example.oldapp)/R.

3. Open R.java file.

4. Right click on package name (oldapp) > Refactor > Rename > Rename Package > Enter your new package name here and click Refactor. And click Do Refactor from right bottom of android studio.

5. Open Module build.gradle file and change applicationId with new package name.(com.example.newapp).

6. Go to top menu > tools > android > Sync Project with Gradle Files.

That’s all. You have changes your android app package name using android studio. If you have any question regarding this topic please feel free to write in below comment box.

Displaying application intro/introduction slider or welcome screen in your android app is the best way of sowing major features of the app to the users at very first time. Only creating new android app is not difficult but how many users installed your app and among them how many users are active current is the most important thing. For that you have to focus on user experience and make app easy to use. App intro slider is one of the best way to show app features and ways to used them to the users.

Previously I have already wrote a tutorial about Splash Screen where you can display a single screen with short message like Welcome to Our App or some progressing activities. In this tutorial you will learn to display application intro screen with sliding function only for the first time. In the app intro slider, you can add as many screen as you like to show. And this is only display only first time to the user when they open app/game.

Related:
How to Make/Create a Splash Screen in Android
Display Images in Android GridView
Displaying Welcome Screen/Message in Android

Creating New Android Project


Let’s start making AppIntro Slider by creating a new project. Create a new project called Android App Introduction Slider using android studio or eclipse with empty activity.
Android AppIntro Slider Example

Adding Dependencies to your Bundle.gradle File


Open your app build.gradle file and add compile 'com.github.paolorotolo:appintro:4.1.0' dependency. Build.gradle will looks like this.
App build.gradle

And in your project build.gradle file you need to add mavenCentral() inside repositories.
Project build.gradle file:

Create AppIntro Sample Slider Class


Create a new class called AppIntroSampleSlider.java and extends Fragment. Following is the java code of AppIntroSampleSlider.java file you can directly copy and paste in your project.

src/AppIntroSampleSlider.java

Create XML Layout for App Intro Slider


Create three new xml layout files under res/layout folder and make app intro slider screens. Here I have added three screens in app intro and layout name are app_intro1.xml, app_intro2.xml and app_intro3.xml. If you want to show more screen in slider you can add according to your needs. Following are the three XML layout file for app info slider.
res/layout/app_intro1.xml

res/layout/app_intro2.xml

res/layout/app_intro3.xml

In above XML layout file I have added different layouts and views and three different images one in each file. Remember to change these images with your own.

Create New Custom Activity Class


Create a new java file called MyIntro.java and extends AppIntro. In this file you can control lots more things like animation type, show and hide Skip and status bar, vibration and lots more. Following is the complete content of MyIntro.java file.

src/MyIntro.java

If you want to change the animation type you can replace setDepthAnimation(); with setFadeAnimation(); or setZoomAnimation(); or setFlowAnimation(); or setSlideOverAnimation(); or setDepthAnimation(); or setCustomTransformer(yourCustomTransformer);

Update your MainActivity.java File


In this file you need to check first run time. Following is the complete content of MainActivity.java file.

src/ MainActivity.java

And default content of activity_main.xml file looks like this.
res/layout/activity_main.xml


Update Styles.xml File


Open your app res/values/styles.xml file and add full screen theme like below.
res/values/styles.xml

And don’t forget to change this in AndroidManifest.xml file. Android manifest file will looks like this.
AndroidManifest.xml

Colors.xml and Strings.xml File


Change the color value of colorPrimary, colorPrimaryDark, and colorAccent in res/values/colors.xml. Also add strings in res/values/strings.xml file. Colors.xml and strings.xml files will looks like below.

res/values/colors.xml


res/values/strings.xml

Now run your application which is looks like above screenshots. AppIntro slider is only visible for first time if you want to check once more you need to clear data from application info (settings/applications/application manager /choose appintro slider and click Clear Data button).

Download Complete Project Source Code


If you want to see complete source code, you can download all source code of this Android AppIntro Slider Example project from GitHub.

An animation is the process of creating shape and motion change. Implementing animations in your android app interface will give high quality feel to your application. Animation in android can be possible from many ways. In android there are mainly two types of animations which are: property animation and view animation, and under view animation there are two types of animations which are in android view animation framework: Tween animation and Frame animation. In property animation you can make an animation defined in XML by modifying an object property values, over a set period of time. View animation supports both frame and tween animations and these both animations are declared in XML file. Tween animation performs fadein, fadeout, rotating, moving and stretching of a graphic by defining in XML. And frame animation shows a sequence of objects.

In this tutorial you will learn to implement animations in your android application with one easy and widely used method of creating animation in android that is view animation (tween animation). This tween animation has some parameters like start value, end value, size, duration and so on. All XML animation resource file should be located in res/anim/animationtypename.xml. To load animation in our android application we have to call a static function loadAnimation() of the class AnimationUtils in your java file.

Related:
Android Bottom/Footer Menu Example with SlideUp Animation
Animated Android Folding Tab Bar Menu Example
Material Ripple Effect/Animation in Android

There are many animation can be implement in android app or game like fading, zooming, moving, rotating, sliding, cross fading, blink, bounce, together, sequential, and many more animations. In this Android XML Animations tutorial we will look up on:
  1. Zoom In Animation
  2. Zoom Out Animation
  3. Fade In Animation
  4. Fade Out Animation
  5. Move Animation
  6. Rotate Animation
  7. Blink Animation
  8. Slide Up Animation
  9. Slide Down Animation
  10. Bounce Animation
  11. Sequential Animation

Android Animation Examples: Working with XML Animation


First let’s create a animation resource directory under res fonder names anim to keep all animation logic in XML files. Following is the one of the sample example of android animation logic in XML file, where we have to set different properties like shareInterpolator, fromXDelta, toXDelta, fromYDelta, toYDelta, duration with different values. Except shareInterpolator all are inside translate.

sample_xml_animation.xml

Load Animation in Android App Screen


To display animation to the users in app screen you have to load from java file. For that you need to use the Animation class. And load the XML animation logic using AnimationUtils class by calling the loadAnimation() function, which will look like below.

Android XML Animation Project Structure

Below is the android XML project structure, where you see the animation xml file, java activity file and android XML layout file.


Android XML Animation Project Structure


Activity_main.xml File



Open your activity_main.xml file and add the different buttons to show different animation when different buttons are clicked with a unique id and onClick attribute. Activity_main.xml file will look like below.

res/layout/activity_main.xml

Main Activity.java File



Following is the complete code of java activity file. Here is no more code just implement onClick button to open new activity and to show different animation when button is clicked.

src/MainActivity.java

AndroidManifest.xml File



In android manifest file we just add different activity name inside <application>  like below.

AndroidManifest.xml

Android XML Animation Layout File



Create a new XML layout file called android_xml_animation_layout.xml and add an ImageView inside RelativeLayout with an id, layout_width=100dp and layout_height=100dp, layout_gravity=center & src attributes like below.

res/layout/android_xml_animation_layout.xml

Android Animation Examples Java and XML Code



Here I have provide you sample XML and java code for most common android animations like fade in, fade out, zoom in, zoom out, move, rotate, blink, slide up, slide down, bounce and sequential animation.

Zoom In Android Animation



For the zoom in animation you can use <scale> tag with scale values like pivotX and pivotY for to start zoom from where in the screen use 50% in both to perform zoom in from center of screen. Likewise use other attributes like duration, fromXScale, fromYScale, toXScale and toYScale.

res/anim/zoom_in_animation.xml

And in java activity file load animation using loadAnimation() function.


src/AndroidZoomInAnimationActivity.java


Zoom Out Animation



Zoom out animation in android is like zoom in animation but the value of toXScale and toYScale are lesser than the value of fromXScale and fromYScale.
res/anim/zoom_out_animation.xml

Java activity file is look like below.


src/AndroidZoomOutAnimationActivity.java


Fade In Animation



For fade in animation use <alpha>  tag with attributes like duration, fromAlpha and toAlpha. Alpha values go from o to 1.
res/anim/fade_in_animation.xml

Now you need to load this from java activity file using loadAnimation() function. Java activity file looks like below.
src/AndroidFadeInAnimationActivity.java

Fade Out Animation



Fade out animation is exactly same to the fade in animation, but the value of alpha is opposite from 1 to 0.
res/anim/fade_out_animation.xml

Java activity file of fade out animation is looks like below.
src/AndroidFadeOutAnimationActivity.java

Move Animation



Move animation is used in order to change position of object using <translate> tag. In translate tag you need to use fromXDelta, toXDelta and duration attributes like below.
res/anim/move_animation.xml

Following is the code of java activity file of move animation.
src/AndroidMoveAnimationActivity.java

Rotate Animation



For rotate animation uses <rotate>  tag with different attributes like duration, fromDegrees, interpolater, pivotX, pivotY, startOffset and toDegrees.
res/anim/rotate_animation.xml

Java activity file
src/AndroidRotateAnimationActivity.java


Blink Animation



Blink animation is animating fade in and fade out in repetitive fashion. For that use tag with fromAlpha, toAlpha, interpolator, duration, repeatMode, repeatCount attributes, android:repeatMode="reverse" and android:repeatCount="infinite".
res/anim/blink_animation.xml

Java activity file looks like below.
src/AndroidBlinkAnimationActivity.java

Slide Up Animation



For slide up animation uses <translate> tag. In translate tag add duration, fromXDelta and toYDelta attributes.
res/anim/slide_up_animation.xml

Java code for slide up animation

src/ AndroidSlideUpAnimationActivity.java


Slide Down Animation



For slide down animation uses <translate> tag like in slide up animation but the value of toYDelta is negative.
res/anim/slide_down_animation.xml

And java activity file
src/AndroidSlideDownAnimationActivity.java

Bounce Animation



For bounce animation uses <translate>  tag. And also uses duration, fromXDelta and toXDelta attributes.
res/anim/bounce_animation.xml

Java Activity file
src/AndroidBounceAnimationActivity.java

Sequential Animation



Sequential animation means perform multiple animation in a sequential manner. For sequential android:startOffset is used from the translation to keep them sequential.
res/anim/sequential_animation.xml

Java activity file of sequential animation is looks like below.
src/AndroidSequentialAnimationActivity.java

That’s all. Above are the different android XML animations examples. I hope you like this tutorial, if you have any question regarding this tutorial you can post in comment box.

Android XML Animations Examples

Download Complete Example Project



You can download complete source code of this Android XML Animations Examples from GitHub.
Powered by Blogger.