In Android oreo Background Execution Limits are introduced. there are certain limits in background running operation in android. if app is in idle mode or in foreground then this limitation is not applied. its apply when app is in background. Also implicities broadcast will not work. you have to create explicite broadcasts.

There is also background service limitations, service will not work in background in android O. You can replace background services with JobScheduler jobs. Android O offers many improvements to JobScheduler that will make it easier to replace services and broadcast receivers with scheduled jobs; for more information, see  JobScheduler improvements here.

Read More

There is little bit changes when we create new notification in android 8.0. You need check build sdk version and create notification. Many methods of  NotificationCompat.Builder is deprecated in android oreo.

sendNotification(getString(R.string.app_name), "hello how are you ? ");

and here is the method for generate notification in android:


 private void sendNotification(String title, String message) {
        Intent intent = new Intent(this, HomeActivity.class);        
        intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
        intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);


        PendingIntent pendingIntent = PendingIntent.getActivity(this, 0, intent,
                PendingIntent.FLAG_ONE_SHOT);


        Uri defaultSoundUri = RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION);
        int icon = Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP ? R.mipmap.ic_notification_lollypop : R.mipmap.ic_launcher;

        NotificationManager notificationManager =
                (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);

        int m = (int) ((new Date().getTime() / 1000L) % Integer.MAX_VALUE);

        if (android.os.Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {

            String channelId = "default";


            NotificationChannel channel = new NotificationChannel(channelId, title, NotificationManager.IMPORTANCE_DEFAULT);
            channel.setDescription(message);
            channel.enableLights(true);
            channel.setLightColor(Color.BLUE);
            channel.setSound(defaultSoundUri, null);
            channel.setShowBadge(true);
            notificationManager.createNotificationChannel(channel);

            Notification notification = new Notification.Builder(this, channelId)
                    .setContentTitle(title)
                    .setContentText(message)
                    .setSmallIcon(icon)
                    .setAutoCancel(true)
                    .setContentIntent(pendingIntent)
                    .build();
            notificationManager.notify(m, notification);

        } else {
            NotificationCompat.Builder notificationBuilder = new NotificationCompat.Builder(this)
                    .setSmallIcon(icon)
                    .setContentTitle(title)
                    .setContentText(message)
                    .setAutoCancel(true)
                    .setSound(defaultSoundUri)
                    .setContentIntent(pendingIntent)
                    .setLights(Color.BLUE, 3000, 3000);
            notificationManager.notify(m, notificationBuilder.build());
        }


    } 


Sometimes ago we submitted android app to google play store, within 2 hours we got email from google play store says
After review, [APP_NAME], [PACKAGE_NAME], has been suspended and removed from Google Play as a policy strike because it violates the impersonation policy.

We have never seen it before. First-time we were experiencing such issue after submitting apps to the google play store. We searched about the impersonation policy and found the mistakes from ourside. App icon and images have copyrights, As a programmer we cannot use them without permission from the owner of it.

First you need to read impersonation policy from google play store:

https://play.google.com/about/ip-deception-spam/impersonation-ip/impersonation/

in my case i opened google play store with diffrent username/email. so i have to send legal document with the app name, package name and client’s name with signature to approve that i am using his/her contents, media and icons. and client gives me rights for that.

i created below document to solve issue(Suggestion: Replace all values in between square brackets):

INTELLECTUAL PROPERTY ASSIGNMENT

THIS AGREEMENT is made as of the [DATE].

BETWEEN:

[APP NAME]

- and -

[ACCOUNT USER NAME] [COMPANY NAME]

RECITALS:

I give permission to [ACCOUNT USER NAME] [COMPANY NAME] to use our logos, website/social media content and branding in order to design
[APP NAME] on our behalf.

App Name: [APP NAME]
App Package Name: [PACKAGE NAME]

/*Suggestion: put below lines left side, remove this one line when you submit doc. */

[ACCOUNT USER NAME]                                                                            

[PUT SIGN OF YOUR COMPANY'S DIRECTOR WITH STAMP]

[COMPANY NAME]


/*Suggestion: put below lines right side, remove this line when you submit doc. */

[CLIENT NAME]

[CLIENT SIGN WITH STAMP]

[APP NAME]

[WEBSITE]

After completion of document, i have sent document on below link with all required information

Open link: https://support.google.com/googleplay/android-developer/contact/appappeals

put all information correctly without any mistakes,

Statement describing why you believe your app should be reinstated *:

[APP NAME] is owned by [CLIENT_NAME], they have given us permission to submit their app on goole play store.

Once we submitted appeal to the play store, after 1 day they accepeted the appeal and allow to edit/submit app. Then you i change app description(remove space ) to activate submit update button. after 2 hours they made my app live.

you can submit this document before app suspension app when you want to upload app firsttime, if you have this scenario.

https://support.google.com/googleplay/android-developer/contact/adv_note

Hope this will help you…

Alpha Testing is conducted within organization and tested by developer/ team of developers/ testers. This testing is close for public.

Beta testing is conducted by the end users who are not programmers, software engineers or testers. This testing may be open for public.

Closed Alpha Testing: This testing is conducted inside organization and restricted by the emails/groups. those who are added in list/groups of testers in google play store they can test app.

Opened Alpha Testing: Those who have Opt-in link of app will test app. This testing is not restricted by emails/groups. You can set numbess of testers in google play store.

Closed Beta Testing: This testing is conducted outside organization and restricted by the emails/groups. those who are added in list/groups of testers in google play store they can test app.

Opened Beta Testing: This testing is conducted outside organization and This testing is not restricted by the emails/groups. This testing is conducted in real time or **live environment**. **App will be live in store and users can install it.  Its open for public**. You can set numbers of testers in google play store.

Generally, Alpha test takes place first, Testing is done by developers or testers within organization, then it goes to Beta testing outside the organization, non technical or end users will conduct test.Beta testing is open for public, Real Time Testing. then finally in software/apps go to production.

In app purchase

License-test users purchase your in-app products without any resulting charges to the user. Test purchases can be used in alpha/beta releases only.

To add Liecence user: Google play Console -> Settings -> Developer Account -> Account details  scroll down License Testing

ORMLite is lightweight Java ORM supports for android Sqlite Database.The full form of ORMLite is Object Relational Mapping Lite(ORMLite).and it provides some light weight functionality to store and retrieve Java Objects.And it avoiding the complexity and more standard Object Relational Mapping.

ORMLite supports more than one database using JDBC and also sqlite with native calls to android database APIs..

ORMLite simply add objects of java using annotations.and its have powerful abstract Database Access Object classes.also provides simple and  flexible query using QueryBuilder.Auto generates SQL to create and drop database tables.and its have basic supports for database transactions.

ORMLite Supports MySQL, Postgres, Microsoft SQL Server, H2, Derby, HSQLDB, and Sqlite and can be extended to additional databases relatively easily.
Provisional support for DB2, Oracle, ODBC, and Netezza.

@DatabaseField(generatedId = true)

     private int id;

     @DatabaseField
     private String name;

     @DatabaseField 
     private String adress;

Suppose, your class is Person

public class Person {

        @DatabaseField(generatedId = true)
        private int id;
        @DatabaseField
        private String name;

 public int getId() {
       return id;
 }
 public void setId(int id) {
       this.id = id;
 }
 public String getName() {
       return name;
 }
 public void setName(String firstname) {
       this.name = firstname;
 }
}

First of All Create object of DatabaseHelper Class.

DatabaseHelper helper = new DatabaseHelper(getApplicationContext());

   Now using helper object you can add java object in ORMLite Database.

Person person = new Person(); 
person.setName(strName);

helper.addData(person); // Add Object in ORMLite Database

Now how to Retrieve Data From ORMLite Database

List<Person> list = helper.GetData();

Delete Data From ORMLite Database.

helper.deleteAll();

DownLoad Full Source Code From Here

DownLoad Source Code

Using Google Chart API we can draw Charts in app.This api provide all chart such as VennDiagram,Pie chart,Line Chart,Radar chart,Scatter plot,Map chart,Radar chart,QR codes,Google O-Meter chart..

Google Chart API with venn diagram chart type.

venn diagram have circles that intersects with each others.So here add different int value for intersects circles.when add  different value for intersects then using http get request we can get image from url.

First url for getting image using google chart api is , http://chart.apis.google.com.then you can add your parameters as per user enter in edittext.

after main url you have to learn about Data Formats.there are  different type for different chart type.here we have venn diagram so use type=v.and  different color for each circle you can do using syntax.chco=<color_1>,…,<color_n>. here color in hexadecimal format. like #00FF00.

google chart api provide various type of styles chart .you can add title,margins and various backgrounds.

So,URL for venn diagram is …My Venn Diagram.

From url you can get Bitmap of charts.

public static Bitmap loadChart(String urlRqs) {
  Bitmap bm = null;
  InputStream inputStream = null;
  try {
   inputStream = OpenHttpConnection(urlRqs);
   bm = BitmapFactory.decodeStream(inputStream);
   if(null!=inputStream)
   inputStream.close();
  } catch (IOException e) {
           e.printStackTrace();
  }
  return bm;
 }
public static InputStream OpenHttpConnection(String strURL)throws IOException {
   InputStream is = null;
   URL url = new URL(strURL);
   URLConnection urlConnection = url.openConnection();
   try {
     HttpURLConnection httpConn = (HttpURLConnection) urlConnection;
     httpConn.setRequestMethod("GET");
     httpConn.connect();

    if (httpConn.getResponseCode() == HttpURLConnection.HTTP_OK) {
   is = httpConn.getInputStream();
  }
       }catch (Exception ex) {                  ex.printStackTrace();
  }
 return is;
    }

then set Bitmap to ImageView.

imageView.setImageBitmap(yourbitmap);

Download Full Source Code From Here.
DownLoad Source Code

Many Android Applications start with Splash Screen.Such as Game applications have app logo or company logo in splashscreen.Splash Screen is a view that appears for sometimes (3 or 4 seconds).After dislaying splash screen that never comes second time in application until we restart Application.

The purpose of a splash screen is to give the user an indication that your app is loading–not to create an extra delay before the user can load your app. People don’t like waiting, especially in a mobile environment.

Using Thread,AsyncTask,Handler you can wait sometimes to load your app.The most desirable way to display splash screen is handler.you can do it easily.no need to create thread or asynctask in your activity.The hadler have postDelayed(Runnable,long)  method.using this method you can wait some times to load app.

Handler instance is associated with a single thread and that thread’s message queue. When you create a new Handler, it is bound to the thread / message queue of the thread that is creating it — from that point on, it will deliver messages and runnables to that message queue and execute them as they come out of the message queue. 

new Handler().postDelayed(new Runnable() {
@Override
public void run() {
}
}, SPLASH_TIME);

Now we have Runnable interface as thread and also have parameter SPLASH_TIME.when you enter long value in splash_time its milliseconds.when handler is called its wait for time first that executes the run method.so we have to put code for next screen in run method.

Create SplashScreen Activity in your project as a first Activity. and put your logo in splash.xml file as background of main layout.then add content view setContentView(R.layout.splash).Now put hadler code in oncreate method.Then put intent in run method.

Intent intent = new Intent(SplashScreen.this,MainActivity.class);
startActivity(intent); 

Now when start activity we need to finish SplashScreen Activity.Because when you came back no need to see splash screen.Using finish() method you can remove activity for activity stack. or put nohistory in activity in manifest file.

SplashScreen.this.finish(); 
or
<activity android:name=".SplashScreen" android:noHistory="true"  />

now Main part of splash screen is animation between two activities.Using overridePendingTransition(start animation,end animation).

overridePendingTransition(R.anim.fadein,R.anim.fadeout);

so create folder anim inside res folder of your project and put animation xml file.

res->anim->fadein.xml
<set xmlns:android="http://schemas.android.com/apk/res/android"
     android:fillAfter="true">
     <alpha android:fromAlpha="0.0"
            android:toAlpha="1.0"
            android:duration="5000"/> //Time in milliseconds
</set>
res->anim->fadeout.xml
<set xmlns:android="http://schemas.android.com/apk/res/android" android:fillAfter="true" alpha android:fromAlpha="1.0" android:toAlpha="0.0" android:duration="5000" </set>
so total code for animation in SplashScreen is  and put it in onCreate  method.
new Handler().postDelayed(new Runnable() { @Override public void run() { Intent mainIntent = new Intent(SplashScreen.this, MainActivity.class); startActivity(mainIntent); } }, SPLASH_TIME); overridePendingTransition(R.anim.mainfadein, R.anim.splashfadeout);

DownLoad Full Source Code From Here
        DownLoad Source Code