What purpose does logging serve in Android Studio? - android

I understand how to create logs but to not understand what they are for. I see that they are like comments in your code expect they show up in run-time. Why would I create a log instead of a comment? What were they created to do?

Logs can be very helpful in general debugging. For example when your application is stuck in, let's say, an infinite loop. You can then Log values to see what is actually going on and where in your application the infinite loop is occurring.
This holds true for every programming language, not just for Android. Comments are only used to clarify your code for other programmers, whereby logging can be a very powerful tool that speeds up your development process.

Related

How do I create a widget on android to display a graph of online data?

I have a profile page as a music curator account, where it shows the score for various parameters there. The most relevant one, monthly listeners, is easily inferred (just a simple excel that I've compiled with the values found on the page), but not shown.
Even though I can constantly calculate it (approximately, because the page might not be consistently updated or might have some flawed calculations), I'm still trying to find a way to have that monthly listeners value updated constantly, and seen as a graph over time.
I was wondering if it's best to do it on android, windows or any other way, to simplify for a complete noob like me, any coding process that i might have to do.
I've only had a little experience in Arduino, so even the basics as to what language to use or the code neccesary for this are foreign to me, but I'm quite interested in learning more about it.
Any help is appreciated, thanks!

What are some important or compulsory tests to carryout on Android?

What are some compulsory test you need to carryout on your application before it goes into production?
If I understood you correctly, you are wondering what exactly you need to test before users see your application?
For me it is divided into two steps: Logic and UI.
Regarding the ui, you need to make sure that your application looks good on different screens and devices, that animations work correctly and views do not lose their positions ...etc
Regarding the logic, everything is a little more complicated, we write scripts to understand if the user will have difficulties with the application. For example, are errors displayed correctly if we receive them, does the application work offline and what exactly is available, do our functions and queries return what we want to get from them, and if not, again, do we inform the user about this.
Maybe if you tell us more about the specification of your application, we can help you even more.

Can I build this quiz client app?

I've been programming for over 20 years, but mostly in the VB and SQL. As a side job, I host game shows at local bars and restaurants (Trivia, name that tune, etc.) and I'd like to develop an android app that I can install on mobile devices to give to customers to interact with the game.
I'm trying to make the game shows more interactive than just pen and paper (and time-consuming, manual scoring). I can get Kindle Fires for $40 each, so I thought it would be cool to create an app that will allow the user to do 3 things:
Choose an answer from a list (Multiple choice), and everyone can answer
Buzz in (blocking other users out)
type in an answer
I'd like the tablets to send the responses to a central "hub" or application that will record the answers so it can automatically do the scoring for me. If possible, I'd prefer to be able to have everything connect through an ad hoc wifi network that I would set up on site (that part I know how to do, too).
I'm not looking to have the questions appear on the phone at this point; I have an office-based application that automates a powerpoint presentation based on questions/answers and other parameters imported from a database/spreadsheet. (VBA is nice and easy for me.)
Ideally, the quiz questions would work like this:
I project the answer where everyone can see it.
After announcing the questions, the tablet apps are "activated" and
the user can then select their A, B, C or D answer (or buzz in, or
type an answer depending the type of questions/quiz).
My hub application would then receive the following information:
team/player name, answer choice, time it took to answer the question
(because I'm thinking of using a points tier that gives faster
players get more points, either based on time ).
The catch is, I don't even know where to begin from an android development standpoint, as I have no experience in that realm. In most programming cases, I know keywords to search on, but I'm totally flying blind here.
Does this seem like a feasibly application? There are systems online that I can buy, but the buzzers are expensive and the software has some significant limitations that prevent me from spending the money. I'd rather develop something myself and spend $40 per client unit and load it up with my software.
(Then, of course, license the whole kit and kaboodle and make a mint and retire in 5 years, living the good life off of my pub quiz empire...)
So, if you have any suggestions on starting points, or specific methods and processes to being fiddling with, an IDE...any help would be greatly appreciated. Once I'm up and running, I will reward you with extra points if you ever come to one of my events.
Go full kotlin !
Android works well with Kotlin and you can have a server quickly setup with : https://start.spring.io/#!language=kotlin
https://kotlinlang.org/docs/tutorials/kotlin-android.html
A good client for Android is provided here :
https://github.com/square/retrofit
You will probably have hard time to get started. Using same language for every part of the system will make things easier.
Also, Kotlin is less verbose than Java and will prevent you to make the usual mistakes found in Java world.
Also, if you create an open source project out of it, you may be eligible for IntelliJ.
Your very first stop is : http://try.kotlinlang.org/#/Examples/Hello,%20world!/Simplest%20version/Simplest%20version.kt
Get to know the language by trying it out. When you are in ease with it, start looking at Anko (https://github.com/Kotlin/anko).
To do the project in an easy way, break it down in milestones.
Simple app which shows 4 buttons (choices) and shows a message for each button. (Eg. you clicked "1")
Small server with spring boot. It should display whatever you post to it. (An "echo" server)
Improvement of the simple app to POST something to the server and display the answer in a dialog.
At that point, you application is practically done! You would have understood enough to complete it. The hardest thing would be behind.
Don't think your are smarter than the flock. Do these milestones, at least. You will be thankful to yourself.
This post may seems unrelated, but I explain how good Kotlin can be in such projects : https://www.linkedin.com/pulse/why-do-android-projects-cost-less-than-ios-christian-baune

Flow of App or program in Android

hi I am a newbie to android programming and I learnt many basic programs and now when I started studying some of the sample programs. I am getting confused about the flow of the program in the areas like one method calling another and so on,
Also I tried DEBUGGING but it didn't work fine as many of the apps need input from user for understanding the complete flow of the program
So is there a way such that newbies like me can first understand the flow of program then dig into the code written over there.
Look at the Android Activity Life cycle on the android developer site.
http://developer.android.com/guide/components/activities.html
Let me know if you have any questions,I will be happy to help where I can.

Removing Logs before uploading to GooglePlay

I have read quite a few questions regarding "Removing Logs" but none answered my question. So, I have to ask here again.
What is the impact of Log.d() or Log.v() or Syso() statements, on the application?
Let's say I have an application with 200 syso() statements, or Logs, that I used to debug while creating the app. I didn't bother to remove them, because, (I am a newbie in android) and I thought, there is no way those statements gets printed or displayed. So, why take the pain of removing all those lines.
So how far my idea of not removing the logs effect the application? Will it increase the size of the application (cached data or something)?
#All, I think you don't are misunderstanding what I am asking for. I know Google advises us to remove the logs, and I am not questioning that. I want to know, what's the impact of those logs on my application, if i don't remove the logs
You should remove all log messages. Else the user can see them via logcat. But nothing will happen with your app (no increase size etc.)
Read this if you want to know how to remove them on the fly while deploying:
Remove all debug logging calls before publishing: are there tools to do this?
Read the section - Preparing Your Application for Release
http://developer.android.com/tools/publishing/publishing_overview.html

Categories

Resources