Someone can post an example of Home Screen widget for Android SDK 2.3.3 with the source files? Just with a TextView will be enough.
In this page you'll find a very basic example (sorry, in Spanish). Don't forget to read the oficial documentation (basically the same info that is posted in the web, but less explained ).
Basically, you need:
Declare a layout for your widget.
Create a xml file, to store basic info about your widget (i.e its size in the homescreen).
Develop the callback methods (onUpdate at least, all others are optional).
Modify the Android Manifest, in order to obtain a widget and not an app.
Compile and test (if you wish to pray, you can do it )
I have tried all that I could.Followed tutorials from theNewBouston,vogella.de,android-dev.
First It was the No Launcher Activity Problem.I Fixed it with a configurator class.But now,after calling the configurator,the app closes.
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
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
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
Hello to all !
post here my question related to the title
I have an app running OK on Smartphones , Tablets , Android boxes
I'm wondering which files must to be basically edited to modify an existing app to get it runing on an Android Tv and firestick
I mean ...have to understand whats the exactly dynamic if editing manifest file reflect automatically edits to gradle ( syncing the project in Android Studio )
I had a read on Adroid official devs documents but to be honest I can figure out how to do things correctly ( edit manifest in the source before open the project in Android studio or edit it when "into " Android Studio ) do I have to manually edit even gradle file ( property and/or app ).
I know that app for TV and firestick have different behavior and doesnt require some activity like touchscreen ... they have to run with remote control , style and layout must be different so you have to add leanback to help you , banner to show in tv home ..
but my difficult is "start" to edit and where exactly to avoid load of warning in res/style and layout running the app with Tv emulator in Android Studio
Sorry for my poor explanation ...I'm an entusiast "homemade" dev