I made a mediaplayer in Android Studio which uses a Service to control playback.
I compared the ram usage with a mp3 player from the store and i noticed most mediaplayers stay below 200mb memory usage.
Mine also stays below 200mb memory but for some reason sometimes 'Google Play Services' shows up in the process list almost exceeding 100mb.
(Settings-> Developer options -> Running services -> My App)
'Google Play Services' uses 97mb and i'm not sure why this shows up.
P.S
I'm using Admob banners in my app so maybe that's the cause? Because i read somewhere banner ads are memory eaters.
Related
I am working on a Flutter application and I have more than 100 sounds that users can play for educational purposes.
I am not using any server or Firebase. Every audio is almost 1 MB. With that assets folder size will be more than 100 and app size will increase too.
Can I store all the audio in the SQLite Database? Is there any other way?
You can compress your audio files using the flutter_sound package, it'll help you to decrease the size of your audio files, and don't forget to run flutter clean before compiling your app, unless your app size will be more than that size that you expect to be.
I have an Android app implementing the Altbeacon library to monitor for beacons while holding a reference to BackgroundPowerSaver(). This is working as expected except on Android N devices, where the library informs me that I am constantly entering/exiting a beacon region even though my device nor beacon are moving.
I have confirmed that this is a bug within the Altbeacon library as the reference app (linked below) also has the same issue when run on an Android N device.
https://github.com/AltBeacon/android-beacon-library-reference
Is there a known work-around for this bug?
I am running the reference app with the 2.1.3 grade build on a Nexus 9 tablet with Android N and am monitoring for RadBeacon beacons. As seen in the LogCat statements, the app believes that it is entering and exiting the beacon region every ~15 seconds. However, the device nor the beacon are moving during this time. The beacon layout I have set my BeaconManager to find is "m:2-3=0215,i:4-19,i:20-21,i:22-23,p:24-24".
Here is the LogCat output.
The issue appears to be caused by a change in Android N's Developer Preview 4:
We’ve changed the BLE Scanning behavior starting in DP4. We’ll prevent applications from starting and stopping scans more than 5 times in 30 seconds. For long running scans, we’ll convert them into opportunistic scans
https://developer.android.com/preview/support.html
I've opened a new issue on the Android Beacon Library Open Source Project to address this change for Android Nougat devices. Please monitor this issue for a preview fix to be released shortly. If you'd be open to test a preview build, I'd certainly appreciate it.
EDIT: A proposed fix is available here. Please follow the instructions on the linked page to test this build with your project and let me know if it resolves the problem.
I have an app I'm currently working on based on the HTC Open Sense SDK for android. However my biggest problem is keeping up with the device checker through the Google Play dev console to only allow certain devices to download the app. My biggest reason is that people will rate my app so low on the scale and say it sucks, but the problem is that they don't read the requirements - if you use an Lg G2 to try and launch an app made for an HTC ONE that requires Sense, it's going to crash.
So, how would i go about building a helper class that would check the device's model via build.prop (without needing root privileges) before opening/starting the main activity, and give the user a notification if the device was incapable of launching the app, and with devices that are capable of launching it, just continue the process of opening the app?
I'm new to android development and right now I'm working on a game. However I was using the emulator first, which I found extremely slow (even though my PC is really good). So I started testing my app on my android device using the usb cable and the "debugging mode" set to "on". Later I got the error that my phone has almost run out of internal hard disk storage. first it was around 70 mb free and now its like 17mb..This is no good as now I would have to format my android phone to release the space... I dont know how Google can leave this bug in the first place..
Is there any other way to clear the invisible occupied space hogged by the app. I only tested the app on the phone. It wasnt Installed via market or manually.
My android phone is Samsung Galaxy Mini, and I was using eclipse for development
Apps you installed through Eclipse are available to be removed through the normal way. Go to Settings -> Applications -> Manage Applications (or whatever it is for your Android version) and select your app. Within this screen, you can delete the app and you can also "Clear Data" and "Clear cache". Clearing these items should free up that space.
That said, I have never heard of an app eating space just for fun. Please make sure you don't have a leak of some sort.
I have an unusual problem. I have a simple activity, which includes nine buttons with background images and background to the main layout.
I run my apps on my Nexus, one which is pretty fast, so I never had problem with the app. Until I updated to Android 2.3.3 (Gingerbread). My app won't run and force closes. Then I deleted the code below,
this.getWindow().setBackgroundDrawableResource(R.drawable.image);
And the app ran fine with no problems. It turned out that the image that I was using was too big, and Android 2.3.3 is somehow slower than Android 2.2. So I used image.png rather than image.jpg, which solved the problem for Nexus One phones. However, the slower phones won't run my app still cause its taking too long to create the activity. So the main Thread is timing out causing the app to crash.
What can I do it in this case?
I finally found the problem. The VM was running out of memory due to the large size of the image.
Each app has 16 MB of memory to play with. If you exceed 16 MB the app will crash. Nexus One has 28 MB of memory for each app.