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.
Related
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
I am new to android studio and would like to make an app that is similar to Goodreads. Can someone outline the key components of making an app like this. It would also be great if I could get some kind of template that I can use. I imagine some of amount of the user information will be kept on the device while some of the other larger sets of information will be kept on a database. What would the code connecting these two parts look like and what other important parts have I missed. Thanks in advance.
Android is a big world and doesn't exist an easy way, I mean all need time to be good at something, but well is not impossible I recommend you start with the Udacity courses
Basic Level:
Developing Android Apps by Google
Android Basics: Data Storage
Android Basics: Multiscreen Apps
Android Basics: Networking
and latter star to flow important people on android world
Android expert even follow in twitter
after that, you have a basic knowledge you can start on other courses https://caster.io/ is a good choice for learn MVP MVVM and other things
also study general programming and Software Engineering : Desing Parrents, Clean Code , Clean Arquiecture, SOLID principles, Versions systems like a Git.
well that my advice for you, good luck and never stop to learn!
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 5 years ago.
Improve this question
I'm trying to develop an app with self-encryption for android.
The idea is following:
app should perform it functions (for example display "Hello world!") but...
the app code stored fully (partially) encrypted, i.e. "all what can be encrypted should be encrypted", so it can not be read by simple disassembling in a right way (i.e. it is literally encrypted (by AES for example) so it is represented to system as a number of random commands/symbols or smth. incorrect).
the "part" of the app should be decrypted before execution;
unused "parts" of the app should be decrypted after usage;
all operations mentioned above should be done by app itself.
So the core idea is self-encryption.
I know what is obfuscation so please don't mention it. The same thing with any side apps. I'm not going to spend all rest of my life in reverse-engineering))). So...
What is the right way to self-encrypt Android (JAVA) code?
How can be implemented the algorithm mentioned above?
Please provide any code snippets if u are able to do such things OR any links/information/articles/pseudocode/ideas
I thing the idea is great and really interesting, plus many people will be glad to know how to protect their apps.
[EDITED]
Thanks #Pace and #JimmyB for custom ClassLoader idea. I'll try to implement it. Also my thanks to #xalo which proposed metamorphic engine concept, I'll dig into this theme because i think it will satisfy my goal to a greater extent.
You shouldn't try to self-encrypt your app, it will add a lot of complexity for not so many protection.
In fact, hacker just have to reverse your decryption routine or to dump memory once the app is running.
Best way to protect against reversing as Java/Android app is obfuscation.
You can also look into remote metamorphic engine concept https://media.defcon.org/DEF%20CON%2024/DEF%20CON%2024%20presentations/DEFCON-24-Amro-Abdelgawad-The-Remote-Metamorphic-Engine.pdf
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.
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 8 years ago.
Improve this question
I never programmed real objects. I only did some JFrame, Swing and a little bit of game Engines.
I've always wondered, is it possible to program real objects? like a web camera Board? if yes, then how? Especially a web camera, how is that possible?
I have a school project about web cameras and I thought on and said to myself, why not program the board to make it more advanced!
The main question is: Can I program real life objects (like a webcam), and how?
Yes you can. Unfortunately Java is not well suited for this task (for various reasons).
I would suggest you buy an arduino set and learn what it can do regarding controlling devices and receiving input from sensors, so you know more about what is possible.
I think you mean if it is possible to create a firmware or program embedded systems in Java. Answering this question is not so easy. If the producer of the "real object" provides you a way, how to create a programs for that real object, then yes, it is possible, but this is quite rare. You can't just buy the cheapest web camera and write your own firmware. Google up some programmable devices, that you can fiddle with or if you are just curious and this is you hobby, then make an application for a smartphone. Android devices are programmed in Java and you can play also with the camera.
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.