Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8248391
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T23:10:34+00:00 2026-06-07T23:10:34+00:00

I have uploaded an app in the Play store and I have received several

  • 0

I have uploaded an app in the Play store and I have received several comments that it has a virus in it and it sometimes forces the mobile to reboot itself. The code in my app is so simple: only one activity that has several spots and either you can hear them or set them as a ringtone. Can you suggest me anything?

Code of my app:

b1_2.setOnClickListener(new View.OnClickListener() {
  public void onClick(View v) {
    if(saveas(soundid,save_name)){
      Toast.makeText(Main.this, "The sound was set as ringtone!",
        Toast.LENGTH_LONG).show();
    };
  }
});
public boolean saveas(int ressound,String filename){
  byte[] buffer=null;
  InputStream fIn = getBaseContext().getResources().openRawResource(ressound);
  int size=0;
  try {
    size = fIn.available();
    buffer = new byte[size];
    fIn.read(buffer);
    fIn.close();
  } catch (IOException e) {
    // TODO Auto-generated catch block
    return false;
  }
  String path="/sdcard/media/ringtones/";
  boolean exists = (new File(path)).exists();
  if (!exists){new File(path).mkdirs();}
  FileOutputStream save;
  try {
    save = new FileOutputStream(path+filename);
    save.write(buffer);
    save.flush();
    save.close();
  } catch (FileNotFoundException e) {
    // TODO Auto-generated catch block
    return false;
    } catch (IOException e) {
      // TODO Auto-generated catch block
      return false;
    }
    sendBroadcast(new Intent(Intent.ACTION_MEDIA_SCANNER_SCAN_FILE,
      Uri.parse("file://"+path+filename)));
    File k = new File(path, filename);
    ContentValues values = new ContentValues();
    values.put(MediaStore.MediaColumns.DATA, k.getAbsolutePath());
    values.put(MediaStore.MediaColumns.TITLE, "clip_"+save_name);
    values.put(MediaStore.MediaColumns.MIME_TYPE, "audio/mp3");
    values.put(MediaStore.Audio.Media.ARTIST, "clip");
    values.put(MediaStore.Audio.Media.IS_RINGTONE, true);
    values.put(MediaStore.Audio.Media.IS_NOTIFICATION, true);
    values.put(MediaStore.Audio.Media.IS_ALARM, true);
    values.put(MediaStore.Audio.Media.IS_MUSIC, true);
    //Insert it into the database
    Uri uri = MediaStore.Audio.Media.getContentUriForPath(k.getAbsolutePath());
    getContentResolver().delete(uri, MediaStore.MediaColumns.DATA + "=\"" +
      k.getAbsolutePath() + "\"", null);
    Uri newUri= this.getContentResolver().insert(uri, values);
    RingtoneManager.setActualDefaultRingtoneUri(
      this, RingtoneManager.TYPE_RINGTONE, newUri);
    return true;
  }

Permissions required are:

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

It works without internet but I just have a direct link to my developers page in google play store and in order to avoid crashes I have used this function:

(if link is pressed)
  if (isOnline()){
    open page
} else {
  do nothing
}
public boolean isOnline() {
        boolean connectedWifi = false;
        boolean connectedMobile = false;

        ConnectivityManager cm = (ConnectivityManager) getSystemService(Context.CONNECTIVITY_SERVICE);
        NetworkInfo[] networks = cm.getAllNetworkInfo();
        for (NetworkInfo ni : networks) {
            if ("WIFI".equalsIgnoreCase(ni.getTypeName()))
                if (ni.isConnected())
                    connectedWifi = true;
            if ("MOBILE".equalsIgnoreCase(ni.getTypeName()))
                if (ni.isConnected())
                    connectedMobile = true;
        }
        return connectedWifi || connectedMobile;
    }
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T23:10:36+00:00Added an answer on June 7, 2026 at 11:10 pm

    First of all, the concept that your Android app “has a virus” is silly. If there is malicious code in your app, then it is because you developed your app with malicious code in it.

    What is more than likely happening here is that your app has a BUG in it. Even worse, the Android SDK that your user(s) are using also has a bug in it (because the OS is crashing and that should never happen). Without going through and analyzing all of your code, it’s going to be pretty hard for anyone on here to give you a direct answer as to where the bug in your code and/or the Android SDK is.

    I would suggest figuring out what devices and SDK versions this bug has been experienced with, and then I would start testing the app on those devices/SDKs. Since you think the bug may be related to internet connection, test the app with internet connection enabled, disabled, and with a weak connection. Keep in mind that it is possible that you are running into a known bug in a previous Android SDK.

    You could also launch your next version with Crittercism (or another similar library) installed to help you track down the crash.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have just uploaded my first app to iTunes Connect and noticed that my
I have uploaded an app on app-store. And I have just forget to remove
I want to know that if I have uploaded a free app on apple
i have uploaded an app to google play but after two days stil cant
So I have uploaded and published an app in Google Play. It's free, but
I have developed an app for kids and uploaded it on Google Play. It's
I have already uploaded an app with inapp products, it has been accepted and
I have uploaded an app to the app store, and now I want to
I have uploaded two APK files into the Google Play store. One is a
I just uploaded an app on google play at US. I have friends in

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.