Add sound for bootanimation - Android Q&A, Help & Troubleshooting

Hi,
I have added the following code on my local AOSP copy (master branch) and it starts up fine but the .mp3 is not playing. After putting more logging message and looking at the logcat I notice that the code didn't continue after calling the MediaPlayer() class
mPlayer = new MediaPlayer();
if (mPlayer == NULL) {
ALOGE("Failed to create MediaPlayer()\n");
return false;
}
Anybody has any experience troubleshooting this or have successfully implemented this gerrit issue ?. I'm testing it using Nexus 7 (grouper).
I cannot post the link to this post so I'm going to spell the link to the gerrit issue out
android-review.googlesource.com slash # slash c slash 38222 slash
Cheers

Not sure how well this works now, I have not messed with the boot sounds in a while now.
https://github.com/lithid/Scripts/blob/master/Android/bootsound.sh
I used to be able to get the boot sounds working with this script I wrote.

lithid-cm said:
....I used to be able to get the boot sounds working with this script I wrote.
Click to expand...
Click to collapse
Thanks lithid-cm.
I managed to make it work, the problem was because the bootanimation.zip contains only .mp3 it should contain the bootanimation logo. I've made a short demo video of using the CyanogenMod logo on an AOSP
youtube.com <slash> watch <question mark> v <equal sign> b0uuHlrJpGI

Related

[Q] P500 Optimus One porting help

Hello @all,
i'm trying to port Firefox OS on my P500, but actually im kind of stuck in creating the proper manifest file. I've got the armv6 cm repo running and building without error from https: // androidarmv6.github.io/.
So as i understand it the hard part is to create a working manifest.xml file for Firefox OS. I'm using this guid https: // developer.mozilla.org/en-US/Firefox_OS/Porting but unfortunately it is missing the whole part in how to transform a working CM manifest into a working Firefox OS manifest.
Here are the working CM manifest:
https: // gist.github.com/delijati/40823071d200bba422b9
https: // gist.github.com/delijati/1c71b8045710e6c81692
So if someone can give me a hint, that would be great.
Thanks
------------------------------------------------------------------------------------------------------------
Just remove the blank and the links are working

ROM Compiling Issues

I'm currently trying to implement native battery percentage into my source built ROM, but keep running into errors. Mainly, this one:
Code:
packages/apps/Settings/src/com/android/settings/rascarlo/StatusBarSettings.java:103: cannot find symbol
symbol : method isPhone(android.app.Activity)
location: class com.android.settings.Utils
if (!Utils.isPhone(getActivity())) {
^
I look at other developers' code and they all have that period there so I am not sure why it is an error for me. Must do more research.
Can you show us the code piece which is creating problem? I think u have missed something like semicolons. or that method isPhone() is not accessible. Show us the particular fragment of code to which error is pointing.
I will be starting work at 3 and won't be back home until about 12:30am. I will post the code then. I don't have the error window open anymore but I will just open the SatusBarSettings.java file and post the code from there.
Here is the section of code where the error seems to be taking place.
Code:
// Quick settings category
// Quick Settings pull down
mQuickPulldown = (ListPreference) getPreferenceScreen().findPreference(QUICK_PULLDOWN);
// only show on phones
if (!Utils.isPhone(getActivity())) {
if (mQuickPulldown != null)
mStatusBarGeneralCategory.removePreference(mQuickPulldown);
} else {
mQuickPulldown.setOnPreferenceChangeListener(this);
int quickPulldownValue = Settings.System.getInt(getActivity().getApplicationContext()
.getContentResolver(),
Settings.System.QS_QUICK_PULLDOWN, 0);
mQuickPulldown.setValue(String.valueOf(quickPulldownValue));
mQuickPulldown.setSummary(mQuickPulldown.getEntry());
I am not sure if it is because I am trying to simply add native battery percentage and do not have quick pulldown or any other status bar mods implemented yet or what.
Also, I am not writing this code myself in case that wasn't clear. I did a cherry-pick of rascarlo's native battery percentage.
Thanks for the help
This seems that isPhone() method is not accessible. Do u have the source code of Utils class? Check into the Utils class for isPhone() method.
Sent from my Micromax A120 using XDA Free mobile app
sumit77seo said:
This seems that isPhone() method is not accessible. Do u have the source code of Utils class? Check into the Utils class for isPhone() method.
Sent from my Micromax A120 using XDA Free mobile app
Click to expand...
Click to collapse
Could you explain a little more in detail what I need to look for?I have downloaded source code and have been trying to just do a cherry pick. How do I check into the utils class for is phone() method?

[Q] My chinese tablet got into DEMO mode.

Hi, i bough a chinese tablet a few weeks ago.
I didnt intalled anything bad or risky in it.
And this night i got unexplicable popups, adds and applications that i didnt installed.
The source of this activity was a app called com.android.server and com.android.popupreciver
I unistalled them and then i rebooted my tablet, then i got a message saying DEMO.
I heard that the only way to solve this is a hard reset, but i would like to know if there is something else i can do.
=====
Else, i would like to know if there is any ROM compatible for a 7" chinese tablet.
Removing Demo mode from Chinese tablets
I have one of these and have not been using it for a long time due to all the unwanted ads and being unable to figure it out. The other day I decided to give it another try and this is what I found:
A lot of these cheap tablets comes with a trojan and on my A23 Q8H 7" tablet it was in CloudsService.apk. If you remove it the tablet will show big red "Demo" letters across the screen. This comes from the SystemUI.apk and when I decompiled it I saw the following:
Code:
private void showDemoOverlay() {
TextView textview = new TextView(this);
textview.setText("Demo");
textview.setTextSize(180F);
textview.setGravity(17);
textview.setBackgroundColor(0);
textview.setTextColor(0xffff0000);
android.view.WindowManager.LayoutParams layoutparams = new android.view.WindowManager.LayoutParams();
layoutparams.type = 2006;
layoutparams.width = -1;
layoutparams.height = -2;
layoutparams.gravity = 17;
layoutparams.format = textview.getBackground().getOpacity();
layoutparams.flags = 24;
((WindowManager)getSystemService("window")).addView(textview, layoutparams);
}
The above function in SystemUIService.java is indirectly called by this one
Code:
private boolean hasOTAServer() {
android.content.pm.PackageInfo packageinfo;
try {
packageinfo = getPackageManager().getPackageInfo("com.clouds.server", 0);
}
catch (android.content.pm.PackageManager.NameNotFoundException namenotfoundexception) {
packageinfo = null;
namenotfoundexception.printStackTrace();
}
return packageinfo != null;
}
So in short all it does is look for is a package called com.clouds.server and if it doesn't find it the Demo is displayed.
The solution is to create a blank app in Android studio, make sure the package name is com.clouds.server and then install it on the device.
Now this I call informed investigation! I was trying to get rid of the trojan on a chinese tab and after removing at least 5 apps and rebooting i got the DEMO overlay.
I found a blog post dealing with the same problem and this person provided an APK to install (I checked it via virustotal and it came back clean): cmcm.com/article/share/2015-11-09/840.html
How did you find out it was the SystemUI.apk showing the overlay? Or was it just an educated guess? I tried finding the app via dumpsys but couldn't see anything...
P.S.: THANKS!!
Surrogard said:
Now this I call informed investigation! I was trying to get rid of the trojan on a chinese tab and after removing at least 5 apps and rebooting i got the DEMO overlay.
I found a blog post dealing with the same problem and this person provided an APK to install (I checked it via virustotal and it came back clean): cmcm.com/article/share/2015-11-09/840.html
How did you find out it was the SystemUI.apk showing the overlay? Or was it just an educated guess? I tried finding the app via dumpsys but couldn't see anything...
P.S.: THANKS!!
Click to expand...
Click to collapse
It has been a while but if you extract all the APK files and run grep on them you should be able to find the one you are looking for. You can then decompile the APK to have a look at the source code. Another way would be to remove the apps one by one and reboot each time. When you find the APK which causes the Demo mode to be activated just replace it with a blank APK file with the same package name and it should be good. If that does not work then it could be that the tablet checks for more things which means you'll have to go with option 1. I would also not trust virustotal with this as there are many reasons why it could return a false result and it does not take too much skills to bypass virustotal checks.
The solution!
Just install a clean CloudsService.
Normal_CloudsService.apk
Mirror1: https ://drive .google .com/file/d/0B1CH2n58TrbiSFl4Y0twRk5LX3M/view?usp=sharing
Mirror2: https ://drive .google .com/file/d/0B65Tvd8zpsRPOFNLY2NTRVMxckU/view?usp=sharing
VirusTotal: https ://www .virustotal .com/en/file/a014b81ce3cbee336a705eb54a0d6081038d67cc34b65688304a3ee41861903a/analysis/1455333414/
cheers
ofernandofilo said:
Just install a clean CloudsService.
Normal_CloudsService.apk
Mirror1: https ://drive .google .com/file/d/0B1CH2n58TrbiSFl4Y0twRk5LX3M/view?usp=sharing
Mirror2: https ://drive .google .com/file/d/0B65Tvd8zpsRPOFNLY2NTRVMxckU/view?usp=sharing
VirusTotal: https ://www .virustotal .com/en/file/a014b81ce3cbee336a705eb54a0d6081038d67cc34b65688304a3ee41861903a/analysis/1455333414/
cheers
Click to expand...
Click to collapse
Thank you!
Note that you might need to do
adb uninstall com.clouds.server
before you will be able to install this one if you get "Failure [INSTALL_FAILED_UPDATE_INCOMPATIBLE]"
it works
I JUST INSTALLED THE APK POSTED IN THE FIRS LINK ... AND IT WAS MY SOLUTION..... I DO IT TO ZEEPAD 7DRK
---- drive.google.com/file/d/0B1CH2n58TrbiSFl4Y0twRk5LX3M/view#! -------
GREETENGS FROM MEXICO LEON GTO
....my english is bad .. i know i know.... jajajaj lool

Youtube Data API v3 - Help please!

Hi, i'm trying to develop one app for a youtube channel. This app will show the uploaded videos as a list (with some infos), show channel infos, trigger notification when a new video is uploaded and etc..
I'm a newbie in Android app development and i'm having trouble with the Youtube Data API... I saw the samples code from google, but when i copy it to my project and try to build it doesnt work at all...
Everything i did until now is just the basics and the designe (a part of it).
Do you guys have some app sample that does the samething i'm trying to do to help me?
Thanks.
I made some progress here, but now i need load the "client_secrets.json", but when i do the command "
getResourceAsStream("/client_secrets.json")", always return null.
The .json is inside "src/main/res" right now, but i tried in almost any other folder and changing the patch in code bellow but got no other result, just null exception ;/
Any help?
Code:
// Load client secrets.
Reader clientSecretReader = new InputStreamReader(Auth.class.getResourceAsStream("/client_secrets.json"));
GoogleClientSecrets clientSecrets = GoogleClientSecrets.load(JSON_FACTORY, clientSecretReader);

Google Chrome User Agent Android 7.x

Hi,
how can i Set Chrome User Agent to Desktop or chromebook on Android 7.x ?
Old User Agent Apps won't work on 7.x
I need to Set Chrome to Desktop view always on
Put a file in Data/Local called 'chrome-command-line', put this text in
chrome --user-agent="Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/33.0.1750.117 Safari/537.36" -force-device-scale-factor=2
Permissions 644, you can change the scale-factor to suit.
Sorry but this is Not working anymore on 7.x
Nobody ?
Just wanted to bump this as I'm also looking for a solution.
This has been bugging me for for a few days, very frustrating, seems like Chrome doesn't read the command line files in Nougat no matter where they are located, what they are called, or how you invoke the application. So I did the next best thing...
I grabbed the latest Chromium source code and modified user_agent.cc so it spits out a desktop UA instead. Cross compiling was a bit of a lengthy process, around 4 hours, but it works perfectly. The code alteration was quite trivial, I know this doesn't really help anyone here with a quick fix, and I really can't see Google adding a permanent desktop mode any time ever.
To make the change, just edit the following and rebuild:
<path>/src/content/common/user_agent.cc
PHP:
std::string BuildUserAgentFromOSAndProduct(const std::string& os_info,
const std::string& product) {
// Derived from Safari's UA string.
// This is done to expose our product name in a manner that is maximally
// compatible with Safari, we hope!!
std::string user_agent;
// base::StringAppendF(
// &user_agent,
// "Mozilla/5.0 (%s) AppleWebKit/%d.%d (KHTML, like Gecko) %s Safari/%d.%d",
// os_info.c_str(),
// WEBKIT_VERSION_MAJOR,
// WEBKIT_VERSION_MINOR,
// product.c_str(),
// WEBKIT_VERSION_MAJOR,
// WEBKIT_VERSION_MINOR);
// return user_agent;
return "<Insert desired user agent here>";
}
dtchky said:
This has been bugging me for for a few days, very frustrating, seems like Chrome doesn't read the command line files in Nougat no matter where they are located, what they are called, or how you invoke the application. So I did the next best thing...
I grabbed the latest Chromium source code and modified user_agent.cc so it spits out a desktop UA instead. Cross compiling was a bit of a lengthy process, around 4 hours, but it works perfectly. The code alteration was quite trivial, I know this doesn't really help anyone here with a quick fix, and I really can't see Google adding a permanent desktop mode any time ever.
To make the change, just edit the following and rebuild:
<path>/src/content/common/user_agent.cc
PHP:
std::string BuildUserAgentFromOSAndProduct(const std::string& os_info,
const std::string& product) {
// Derived from Safari's UA string.
// This is done to expose our product name in a manner that is maximally
// compatible with Safari, we hope!!
std::string user_agent;
// base::StringAppendF(
// &user_agent,
// "Mozilla/5.0 (%s) AppleWebKit/%d.%d (KHTML, like Gecko) %s Safari/%d.%d",
// os_info.c_str(),
// WEBKIT_VERSION_MAJOR,
// WEBKIT_VERSION_MINOR,
// product.c_str(),
// WEBKIT_VERSION_MAJOR,
// WEBKIT_VERSION_MINOR);
// return user_agent;
return "<Insert desired user agent here>";
}
Click to expand...
Click to collapse
Would it be possible for you to share the apk? This is frustrating me beyond belief after I moved to Nougat.
Found a solution for this problem, it was caused by a SELinux context which blocked read access to the command line file.
Download this script and copy it on the SDCard.
Install Android Terminal Emulator, then enter:
Code:
su
sh /sdcard/chrome.sh
- Testing 7.x fix. https://play.google.com/store/apps/details?id=com.linuxjet.apps.ChromeUA
jpeterson said:
- Testing 7.x fix. https://play.google.com/store/apps/details?id=com.linuxjet.apps.ChromeUA
Click to expand...
Click to collapse
Thank you. Is this working for anyone?
cobram3 said:
Thank you. Is this working for anyone?
Click to expand...
Click to collapse
It is available on the play store. I can not guarantee this will work, but I have tested it on my 7.x devices and 8.x devices and it is working on them.
Does not work on my OnePlus 5T on Android 8.0 rooted with Magisk.
Neither does the script posted above.
Any other ideas? I'm sick of manually selecting "view non crippled site" every time I open any webpage.
"Mobile" sites need to die!
EDIT: I figured it out, I needed to set the /data/local directory to be readable by all. (The script above already got the file permissions right for the chrome-command-line file, just not the directory it lived in). After that the user agent string seems to be working as it should and I can actually view useful webpages again!
Well, so much for that.
I wiped my phone and started over, and the same steps I used last time have no effect this time. I'm stuck in mobile website hell.
Anyone with any idea how to fix this?
EDIT: This seems to be related to the file permissions issue still, but I'm not sure how to fix it. When I'm not root, I get permission denied when I do an ls on the /data/local directory, despite that directory, and all the ones above it, being set 755. So whatever is blocking me from being able to ls that directory is also likely blocking the ability for chrome to read that file and behave like a useful web browser instead of a completely crippled one.
ve6rah said:
Does not work on my OnePlus 5T on Android 8.0 rooted with Magisk.
Neither does the script posted above.
Any other ideas? I'm sick of manually selecting "view non crippled site" every time I open any webpage.
"Mobile" sites need to die!
EDIT: I figured it out, I needed to set the /data/local directory to be readable by all. (The script above already got the file permissions right for the chrome-command-line file, just not the directory it lived in). After that the user agent string seems to be working as it should and I can actually view useful webpages again!
Click to expand...
Click to collapse
You can create a "chrome desktop"widget with that app,only by this way,it seems to work.
Unfortunately that only works for opening the browser and does nothing for links clicked in our applications.
Why do developers of websites hate mobile users? This isn't 1998 anymore, people want to access websites from their phones! We shouldn't have to resort to such ridiculous lengths to enable such basic functionality as a working web browser!
https://forum.xda-developers.com/showthread.php?t=1811101&page=13 #128
That helps quite a bit.
Now of course I've run in to another problem. AMP. google assistant and related products love to push AMP pages instead of websites, and chrome won't open them in desktop mode, only in mobile mode. I wonder if there's some way to convince Google assistant to behave and link to real webpages?
*sigh* it's amazing how far companies are willing to go to cripple their websites!
EDIT: Found it! DeAMPify in the play store translates all those external programs (like the google feed) to non amp versions before passing them to the browser.
With enough steps and work-arounds you too can have a functioning web-browser on your smartphone!
I'm here to confirm Wootever's script working on [ROM][8.1.0][STABLE][OFFICIAL][TREBLE] AospExtended ROM V5.4 [Z2 PRO]. I had already created the chrome-command-line file via file explorer and set permissions to 755, but it wasn't working. Customized the UA string to my liking, btw (X11; Linux Arm64).
The way G00gl€ is developing Chrome is fLIck1ng annoying, this is basic functionality being set aside because fLIck you. Latest Android Chrome versions (63 to 66) are a piece of sh1t imho.
Cheers
Wootever said:
Found a solution for this problem, it was caused by a SELinux context which blocked read access to the command line file.
Download this script and copy it on the SDCard.
Install Android Terminal Emulator, then enter:
Code:
su
sh /sdcard/chrome.sh
Click to expand...
Click to collapse
Does anyone still have this file?
Reupload
Reupload ulozto.sk/file/R55e4UbG3ppA/chrome-sh

Categories

Resources