Android Camera API - Force Close Does Not Release Camera Resource [closed] - java

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 4 years ago.
Improve this question
So while developing a custom camera application I've realized on rare occasions and on various devices if the app has to force close, it does not always release the camera resource.
Is there a way to find/detect the process that is holding onto this resource and kill it? Or some other technique? It is rather difficult bug to reproduce (for me anyway), but ultimately the device has to be restarted.
Thanks!

From chasing up on all the other posts you have made on this subject, it appears like there is no sure fire way of getting the camera back after a crash without a restart of the device. A pain, to be sure. Best option is not to crash / catch everything that might fault. Which is a pretty rubbish answer, but that's what I'm endeavouring to do now.
Lots and lots of try catch !

I suggest you to see the code of google sample apps completely. the link is as follow.
https://github.com/googlesamples/android-Camera2Basic
As you can see in Camera2BasicFragment, mCameraOpenCloseLock Semaphore used to resolve release resources problems.

Related

How can I improve my Android Studio App Performance [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 3 years ago.
Improve this question
It just so happened, that I have created a class that has 1000+ lines.
After installing the app on the device, the application starts slowing the device really hard. Will rewriting this script to three different classes, approximately 300 lines each, solve my issue?
If your application uses the internet, it is possible, that the phone has a worse connection than your comp. Slower connection - you have to wait...
Read responsive App and App performance - VERY useful. you will know the name of your problem - bad responsiveness (not performance) - for better further searches
No. The problem is not about how many lines are there, or how many classes, it is about the complexity of the algorithms and time each action takes.
Try to use Threads or Handlers while possible to make the app more responsive.
Also, don't do too much work inside onCreate(), onResume() methods to make the app load faster.
Use Systrace. It is a great tool provided by Android community to help improve your app's performance by giving a detail info on what is happening in your app at a very low level.
It has many tutorials on how to use it available as official docs and on there YouTube Channel. But surely this software will do only good if you have some core concepts about the android operating system and how memory, threads etc are utilised. But you can also learn them along the way.

Is it possible to make an Android keylogger which works in the background in working time? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 4 years ago.
Improve this question
A company asked me today that if I could develop a keylogger inside their company application which logs what their workers do in working time with their company phones. They suspect that not every employee works hard enough.
Well I know it's not ethical but I got curious whether it is at all possible? I think Android has enough security feature to make it stop an app like this. I saw some keylogger features on GitHub but they only log inside the app, not outside the other applications.
Another approach you might be able to take would be to develop a fork of the Keyboard, and force users to use that keyboard via a Device Administrator Policy. However, as previously mentioned, this might be in violation of a whole host of employee data protection laws.
Custom Keyboard Creation Tutorial: https://code.tutsplus.com/tutorials/create-a-custom-keyboard-on-android--cms-22615

Prohibit app access in android [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 6 years ago.
Improve this question
My question is if it's possible to create an app where the user can temporarily block several apps, so he can prohibit using an app for an optimal time?
Yes, I've done that.
As a rough solution, if you set your 'controller' app as an accessibility app then it has the ability to monitor which apps are launched. Then you can apply your logic to determine if an app is allowed to be run at this time. If it should be blocked then you can launch a full screen overlay to block that app and show a warning/ block message instead.
I'm not sure about your exact intentions, but generally it is possible, of course, with some limitations - many applications for parental control do this. You need to check out AccessibilityService documentation to dive deeper. This test project may help you to understand some basic concepts - in it I demonstrated how you could block applications, which use INTERNET permission.

Upload video in Android with Volley [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 7 years ago.
Improve this question
I'm trying to upload video with Volley using a POST request but i don't know how create the stream of byte of a .mp4 video saved on my Android phone. Can someone help me?
Thank you.
Your approach is not the good one, I'd say. It could work but there are much simpler ways: why don't use a File and upload it to your server as a multipart/form request for instance: this answer is really good in this way.
It could be that it's not gonna work with big files and you won't be able to add a progress bar with this option.
I'm a big fan of Volley but it is pretty obvious that it hasn't been design for heavy file transfers and is focused on consuming a simple REST/JSON API. Therefore, I would recommend to switch library to something designed for your needs like this one (Android Async). It is, to me, much better FOR THAT PURPOSE (and if you need a webserver too!)
Hope it helps

java/android - Can I edit phone mechanics with java instead of just apps? [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 9 years ago.
Improve this question
I've been wondering, since you can make apps and such using the ADK and JDK, is there a way to change certain mechanics on the phone itself aswell?? like themes, actions when starting apps, calls, the browser, etc?
You cannot. Most of the actions you describe are executed as "root" user, which has access to EVERYTHING on your phone, while (normal) apps are executed as user, which lacks those rights. There are exceptions to this in the form of apps that run as "root", but these require you to go through a process that is aptly named "rooting your phone". This however is not recommended unless you know what you're doing.
What you describe is the creation of a custom ROM. Taking the original source code, modifying it, and then packaging it so it can be installed on another phone.
This is a very difficult and complex task, especially when you want your modification to be available on different phones. They all have unique specificities and most likely will need specific versions of your mod.

Categories

Resources