• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

PackageInstaller not prompting

I am using PackageInstaller to prompt for an update of own app from apk file.

The commit() call is not prompting for the update, and there is no exception.
Does anyone have an idea?

CODE:

void promptApkUpdate(Activity activity, File file)
{
if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP)
{
PackageInstaller.Session session = null;

try
{
PackageInstaller packageInstaller = activity.getPackageManager().getPackageInstaller();
PackageInstaller.SessionParams params = new PackageInstaller.SessionParams(
PackageInstaller.SessionParams.MODE_FULL_INSTALL);
params.setAppPackageName(activity.getPackageName());
int sessionId = packageInstaller.createSession(params);
session = packageInstaller.openSession(sessionId);
packageInstaller.registerSessionCallback(createCallBack());
addApkToInstallSession(file, session);
// Create an install status receiver.
Intent intent = new Intent(activity, MainActivity.class);
intent.setAction(PACKAGE_INSTALLED_ACTION);
PendingIntent pendingIntent = PendingIntent.getBroadcast(
activity,
sessionId,
new Intent(PACKAGE_INSTALLED_ACTION),
0);
IntentSender statusReceiver = pendingIntent.getIntentSender();
// Commit the session (this will start the installation workflow).
session.commit(statusReceiver);
}
catch (IOException e)
{
throw new RuntimeException("Couldn't install package", e);
}
catch (RuntimeException e)
{
if (session != null)
session.abandon();
}
}
}

void addApkToInstallSession(File apkFile, PackageInstaller.Session session)
throws IOException
{
if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP)
{
// It's recommended to pass the file size to openWrite(). Otherwise installation may fail
// if the disk is almost full.
try
(
OutputStream packageInSession = session.openWrite("package", 0, apkFile.length());
InputStream is = new FileInputStream(apkFile.getAbsoluteFile());
)
{
byte[] buffer = new byte[16384];
int n;
while ((n = is.read(buffer)) >= 0)
{
packageInSession.write(buffer, 0, n);
}
}
}
}

help how do i fix this?

If the factory reset didn't remove your digital STDs, they have been written into the operating system. You need to take the phone to the Samsung store and have them completely wipe the phone: boot, recovery, data, system and cache partitions, and reflash the entire thing. It may be faster to exchange it so they can send it back to the depot for a complete wipe & reflash.

And NO MORE $1 adventures!

:D

Help Is there a way to hide default labels like Snoozed and Scheduled in the Gmail app?

Hi @kwhopson, you can't edit or hide labels from within the Gmail app. You have to use a computer and web browser.

A Google search produced this which may help :-

"As stated in this Help document, you cannot delete labels using the Gmail app in Android. And on a computer, you can only delete user created labels. But you can hide labels so that they don't show.
On your computer, open Gmail using mail.google.com. Click the gear icon in the upper right. Select Labels. Next to each label you don't want to see, click Hide. If ever you want one back, click Show".

Help Is whAt?...!

not according to this website:
https://hudly.zendesk.com/hc/en-us/articles/115003409128-List-of-MHL-Enabled-Phones

you can also download MHL Checker from the play store.

Okay, thanks for the info. Unfortunately, Huawei contacted me and they replied:

Hi jaredo-kun! Thank you for supporting Huawei Products. We appreciate bringing this to us. As we check on our end, the Y6 2018 does not support MHL. We will take this as a feedback for us to better improve our products and updates. Have a great day.

Sooooo, yep. Huawei Y6 2018 doesn't support MHL.

That's it for the thread!

Volume increases on its own

I have only ever had this issue with wired heaphones/speakers.

Quite annoyingly, it will often open up Google Assistant, which I detest in the worst way.

As for wired devices, I think it is caused by a bad/dirty connection between the phone jack and the plug, and/or the plug and the cord.

The phones/speaker may even work perfectly fine when connected to other equipment.

So to me, this means that even a change in impedence could cause this.

However, none of this would be involved with wireless phones/speakers.

Now, I have recently obtained yet another bluetooth speaker.

Each one I get seems to be quirky in its own right.

This one, which also has a built in mic so that I can use it for calls, somehow triggers the device to jack the volume to the maximum (in about two brief steps) during a call, and I don't believe that the volume returns to normal when the call is disengaged.

Sorry, the speaker is pretty small, so it really isn't much of an issue- so I haven't paid close enough attention to have noticed.

Quite possibly, there is a volume control on your phones/speaker (almost assuradly on the speaker(s)).

So what to do if the speaker has volume control?

Leave the volume on your phone all the way up. It seems to like this anyway, right?

Control the volume from from the speaker.

Without going into more blah, blah, blah, etc. as to why, there is a volume that a speaker can handle constantly- indefinitely if you will- and that is approximately 71% of its total volume.

On an Android phone with 15 volume steps (typical in my experience) this is close to 10 volume steps from 0.

As long as you remain at or below this amount at the speaker's end, you should not damage anything.

And yes, techically you can inverse this, by having the speaker volume at 100% and not going past 71% on your phone.

But your phones have not been consistant, so as inconvenient as it may be, controlling the volume at the speaker may be the best solution.

And, because of there being 15 steps of volume, the numbers don't quite work out to that golden 71%.

It is a user's choice between 67% and 73%.

Generally I find that 67% is just right to a bit too soft, and 73% is just right to a bit too loud.

Fun, right?

Anyway, the Androids that I have dealt with do not hurt themselves when played at full blast- unless you use sound enhancing apps- like equalizers, bass boosters, volume boosters, etc. and overdrive the internals.

You will hear distortion at that point.

Distortion is always bad in this case.

Android does a pretty good job of preventing overdriving itself like this, but it still can happen.

This can actually damage internal audio parts.

This is why sometimes when you use an EQ to boost some frequencies the total volume actually seems to decrease. This is Android protecting itself.

And digital music is not much help either, as it seems that almost every song is recorded at a different level.

Of course, the loudest one in your library will play right before the quietest one, or vice-versa.

Is it on purpose?

Only God knows, but it is fun to speculate, lol.

P.S.
On two of my bluetooth speakers, the 'skip ahead/back' buttons raise and lower the speaker volume when pushed in and held.

Issues with Google assistant and WhatsApp calls

You have a Samsung, correct?

Isn't the assistant app on a Samsung called Bixby?

So what you need to do is to change the default assistant app to be the one that you desire.

As I don't have your device, the best I can do is to show you how to access the assistant default app settings on the device that I am using at the moment.

It is an Android, so the directions should be similar, although may not be exact.

At any rate, since your new to Android, this will give you sort of a brief and limited tour around a few of the settings.

Start from the homepage.
Goto:

Settings
Apps & notifications
Advanced
Default apps
Assist & voice input

Assist
(and or)
Voice input

Here is where you can make your selections.

Privacy protection password forgotten

After re-reading through your postings a few times, it seems there's an issue involving some mixing of definitions and semantics involved that are making the initial problem more complicated.
-- There's a password issue involving his Google account, something that based on his Gmail address and password. It will relate directly to his online Google account so it has a very high priority status. It's also most likely what he used to authenticate his phone. It will involve things like online syncing with Google services and Play Store account access but it's not SIM locking.
-- There's a lock screen issue, that relates only to his phone. It's a security and privacy measure that keeps others from easily accessing the contents of his phone. Some apps, like banking apps, will rely upon the lock screen (i.e. fingerprint, pass code, etc.) to work. But the lock screen applies to the phone itself, it's not going to apply to his authenticating himself to his online services, nor is it used as a SIM locking service.
-- There's a SIM-based PUK issue, might have been the original issue to address. The Personal Unlock Key is typically a passcode. It relates only to SIM access.
https://www.wikihow.com/Determine-Your-Mobile-PUK-Code
The three are not inter-related, they each apply to different aspects.

Thanks boss, have actually given it to an engineer, but just in case of next time.
Am really grateful boss..

Call info - nothing there

Sometimes when I get a call from a number I don't recognize, I'll let it go to voicemail. Then I'll check the history of the number to see if maybe it was someone (a biz maybe) I had called earlier and they were returning my call. I do this by touching the number and getting options - add to contacts, call, message, video chat, and and info button. I click on the info button and am supposed to see the call history. However, my phone app displays a blank screen and freezes. I must go to recent app menu and close the phone app. Attached is what I see when I click on the info button. Thoughts?

Attachments

  • Screenshot_20200730-134151_Phone.jpg
    Screenshot_20200730-134151_Phone.jpg
    32.9 KB · Views: 295

[SOLVED]Battery going down fast

My Redmi 4X sometimes got very warm for no reason. The battery was new and original. I noticed that it happened when I used this all the time with no rest in between, and immediately charged the device. To resolve this, I closed all apps, switch off, let the device to cool for like 1 hour. Then used it again or charged the battery. Somehow it solved the problem...

Filter

Back
Top Bottom