Bringing security in FitRadar solution

In this article it is time to talk about how we secure our mobile application and our back-end API. Most of the information displayed in Fitradar mobile application is user dependent. Starting with user profile that has unique information for each user and can be changed or deleted only by the owner of the profile and ending with sport events map and timeline where information is built based on user preferences. And we have to provide access to third party integration services like Firebase Storage and payment gateway. As you can imagine in order to allow our application users to store and access personal information in a secure way we needed to implement user authentication and authorization.

It was clear from the very beginning that we are not going to develop our own authentication service but instead we will use third party solution. And before we started to explore available solutions we laid down following requirements:

  • the access to Fitradar Web API should be granted only to authenticated users
  • the access to Fitradar mobile application should be granted only to authenticated users
  • the access to Fitradar Web API should have different privilege levels
  • the access to third party resources like Firebase storage should be granted from the same authorization service
  • the sign up and sign in pages should be part of the Fitradar app

After some investigation we came to conclusion that combination of OAuth2 and OpenID Connect protocols is the best solution for our needs since it:

  • provide a mechanism for our resource and third party resource protection
  • authenticate users using local or remote account store

Once we were clear about the authentication flow and protocols we started to look for the OAuth2 and OpenID Connect protocol implementation providers. First we wanted to have as much as possible control over authorization service, because we didn’t want to land in situation where authorization service would restrict our application look and functionality. For example RFC8252 (OAuth 2.0 for Native Apps) states that: “OAuth 2.0 authorization requests from native apps should only be made through external user-agents, primarily the user’s browser.” And that might enforce our app to use authorization server sign in and sign up user interface. And since on our back-end we are using ASP.NET Core we decided to use IdentityServer. For a while it worked quite well, but then we started to noticed that there are few aspects of the OAuth2 protocol that we have to implement by ourselves, like Access token lifetime in our mobile app. So we started to feel that we are spending too much time on implementing and maintaining the protocol features that we were quite sure should be working out of the box. Although IdentityServer offers full fledge OAuth 2.0 and OpenID Connect implementation but we still had to host it on our environment and maintain it by ourselves. And the maintenance question bothered us the most. For the startup company with limited human resources to have a solution that might require an administration seemed for us a high risk. If something goes wrong with authentication we will have to put all our effort to fix it, which means the other work will suffer from it. So we decided to look for a cloud solution that would free us from the maintenance burden. And once again we searched for available authentication and authorization providers but this time on a cloud. And after a while we came up with two potential providers: Firebase Authentication and Azure Active Directory. First Active Directory seemed a good solution for our needs:

  • very well established user management system (although we just needed a tiny portion of all available feature)
  • good documentation and code samples
  • very easy integration with .Net Core
  • possibility to use custom sign up and sign in pages

Although Azure AD integrated very well with our Web API and there are good sample projects how to use it with Android and iOS applications we were not sure how well it will integrate with Firabase Storage that we are using to store user images. It turns out we can grant the access to the Firebase storage resources only to Firabase users. To integrate with other OAuth providers Firabase creates a new user account after user has signed in for the first time and links it to the credentials. The fact that we would have user accounts on two authorization servers that we have control over really held us back from integrating Azure Active Directory B2C in our solution. From the other hand we were hesitant to start to use Firebase Authentication service in our ASP.NET Core solution as well, since we were not sure how much time and effort it will require from our team. But after all the Firebase Authentication is just another OAuth 2.0 and OpenID Connect provider that issues identity and access tokens and Jwt bearer authentication middleware in ASP.NET Core application can validate those tokens and authenticate a request. So we decided to spend some time to create a proof of concept project that would show us how much time we will have to invest in order to integrate Firebase Authentication in our Web API authentication solution. And it turns out that requires just a few lines of code in Startup.cs file:

services
    .AddAuthentication(JwtBearerDefaults.AuthenticationScheme)
    .AddJwtBearer(options => {
        options.Authority = "https://securetoken.google.com/fitradar-firebase-project";
        options.TokenValidationParameters = new TokenValidationParameters
        {
            ValidateIssuer = true,
            ValidIssuer = "https://securetoken.google.com/fitradar-firebase-project",
            ValidateAudience = true,
            ValidAudience = "fitradar-firebase-project",
            ValidateLifetime = true
        };
});

And bellow is the final solution we are using to secure our and third party resources and authenticate a user

Please visit our website and join the mailing list. Our app is coming soon:

http://fitradar.me/

50 Great Reasons To Exercise

  1. Lifts your mood
  2. Improves learning abilities
  3. Builds self-esteem
  4. Keeps your brain fit
  5. Keeps your body fit & able
  6. Boosts mental health
  7. Boosts your immune system
  8. Reduces stress
  9. Makes you feel happier
  10. Has anti-aging effects
  11. Improves skin tone and colour
  12. Improves sleeping patterns
  13. Helps prevent strokes
  14. Improves join function
  15. Improves muscle strength
  16. Alleviates anxiety
  17. Sharpens memory
  18. Helps to control addictions
  19. Boosts productivity
  20. Boosts creative thinking
  21. Improves body image
  22. Gives you confidence
  23. Helps you keep focused in life
  24. Improves eating habits
  25. Increases longevity
  26. Strengthens your bones
  27. Strengthens your heart
  28. Improves posture
  29. Prevents colds
  30. Improves appetite
  31. Improves cholesterol levels
  32. Lowers risk of (certain) cancers
  33. Lowers high blood pressure
  34. Lowers risk of diabetes
  35. Fights dementia
  36. Eases back pain
  37. Decreases osteoporosis risk
  38. Reduces feelings of depression
  39. Prevents muscle loss
  40. Increases energy and endurance
  41. Increases sports performance
  42. Increases pain resistance
  43. Improves balance and coordination
  44. Improves oxygen supply to cells
  45. Improves concentration
  46. Helps with self-control
  47. Lessens fatigue
  48. Increases sex drive & satisfaction
  49. Makes life more exciting
  50. Improves Quality of Life

Visit our website and join the waiting list. Our app is coming soon:

http://fitradar.me/

Bringing order in files

One of the main paradigm we followed during Fitradar application development was Object Oriented Programming paradigm. And the main objectives of OOP are:

  • to organize the code in such a way that data and functions using its data stick together in one entity (class),
  • to extract reusable parts in separate entities (classes interfaces).

And as we followed the OOP principles and patterns our big code evolved in to many small files, each representing one or sometimes several entities. Each file contained clean and well organized code that was easy to maintain. From one hand we reduced the size of the files and such improved the navigation within a file but increased the number of files. And the more files we produced the more harder it became to navigate between the files. And very quickly it became clear that we need a new way how to organize our code-base files that anyone could quickly find a needed file. And since there are several ways how to organize the files in packages and the source code packaging really depends on the project, in this article I wanted to share our teams experience on how we found a way that helped us to find file quicker in our code base.

The goal of organizing files in packages is to allow a developer or any other person who is working with a source code easily find a needed data type. In order to achieve this we had to introduce particular principles on how to organize files within a packages. And once a person learns these principles it should be a breeze for him to find a necessary type. When we thought about it, we came to conclusion that these principles should act like search algorithm but for human. The basic partition of our source code in separate projects was predefined by Clean Architecture. It gave us a basic understanding where to put files on the high level. In our first attempt we tried to put the same type data under the same package. For example all the repositories definitions we kept in package com.fitradarlab.fitradar.domain.repository, all the retrofit endpoint definitions we kept in package com.fitradarlab.fitradar.data.net.endpoints and so on. This kind of approach introduced by Clean Architecture worked well in data and domain projects, but when we tied to apply it to the UI project it didn’t really helped us. And the reason was the way how we worked with UI part of the project. Our work was organized around the use cases. And to implement a use case on the UI level we had to work simultaneously on Activity, Fragment, ViewModel, Dagger dependency Module, layout and navigation. All these types were located in different packages and under each package there were already quite a few other files and therefore it was hard to find a needed file fast. First to mitigate the problem we tried to keep all the files of a use case opened, but we realized quickly that the more files we open in Android Studio the less we see of a file name in a tab because it shrinks. So even on our big screens we could have only 5-7 files opened, but in many cases we needed more than that. It was not right away that we noticed that the files we try to keep opened belong to one use case, but once we realized that it became clear that we need to put those files under the same package. Once this discovery was made the new packaging structure for UI project was born. We completely refactored UI project by introducing packages that reassemble the names of our use cases. And thanks to Android Studio refactoring tools it took only a few hours, and after that we really felt comfortable with the new packaging structure. Now we didn’t have to keep the bunch of file opened because all the files we needed to work with were visible under the single package in Project window.

New UI project package structure

But there was still one problem left – the resources files. Contrary to source code where developer can create a hierarchy of packages the resources have only several predefined folders and the most used resource types like layouts and drawables usually have long list of files. And once again we applied the use case approach and came up with following naming convention for our layout files: the layout file starts with the type – fragment, activity, row or view, then we mimic the name of the package and the name ends with unique name of the layout. For example the layout for our timeline page has the name fragment_sport_event_timeline.xml. Unfortunately we still can’t find a good naming strategy for drawables and other shared resources that are not bind to particular use case, but already now with these new naming conventions we see a noticeable improvement in our source code maintenance.

Visit our website and join the mailing list. Our app is coming soon:

http://fitradar.me/

10 Things Your Personal Trainer Won’t Tell You

Sometimes it can feel nearly impossible to get yourself in shape, which is why personal trainers are so helpful. Not only do they give you that extra push, but you also get the benefits of their expert knowledge and experience. Even with their guidance, however, your efforts will be in vain if you aren’t following the right diet and fitness regimen for you. To find out exactly how you can improve your fitness routine, WD spoke with top-notch personal trainers for their secrets to getting the most out of your workout and living an overall healthier life.

1. Set realistic goals and be confident.
Before starting your path to a healthier lifestyle, it’s important to be realistic about how much time you have for the results you want, and how you can achieve them. Colleen Faltus, private trainer at The Sports Club/LA in Boston, suggests compiling “a list of both short- and long-term goals. This will keep you motivated to accomplish and surpass them; it will give you focus and add some variety to your workout.” Another trick to staying focused? Be confident! Trainer Bill Trimble, founder of the workout program Extreme Bill Trimble, says, “if you’re not confident and determined you can achieve your goals, you won’t. Make sure you try to stay positive and keep your head up, even on those rough days.”

2. Get specific about what you want to achieve.
Although you may think your trainer will automatically know what you want, that isn’t the case. Trimble says telling your trainer exactly what your goals are is the key to success. A weight-loss plan, for instance, will be different from a plan for someone trying to build muscle. Your trainer will design a routine based on your individual needs and lifestyle, so letting him or her know exactly what you want up front will help you get the most out of the experience.

3. Have fun!
“Working out should be enjoyable. Your personal trainer is there to push you a little bit, but not intimidate,” says Trimble. During your initial consultation, talk with your trainer about activities you enjoy, your schedule and exercises you don’t particularly like. This way, he or she can devise a routine you’ll love. Another key factor to having fun is variation. “Incorporating other elements of fitness besides cardio will increase the likelihood of faster and more efficient weight loss,” explains Faltus. Another plus? You’re less likely to become bored if you try new things.

4. Performing each exercise correctly is imperative, so watch your form.
To achieve the best possible results and stay injury-free, follow your trainer’s instructions about proper form. This is especially important if you’re doing an at-home workout on your own. “Model the video or demonstration exactly, paying special attention to the trainer’s breathing technique and form,” Trimble urges.

5. You should begin to see results within 12 weeks.
Depending on your workout plan, the three-month mark can be a good indicator of how you’re doing. “In about 90 days, you should be able to notice results—whether it be that your jeans are a little looser, your quality of sleep is better or you just feel good all around,” Trimble says. Many people lose motivation if they don’t see results sooner, but you’re changing your physique, so 12 weeks is about how long it will take before your workouts begin building lean muscle.

6. Communication is the key to success.
As with any relationship, communication is vital when it comes to a healthy and happy experience. Faltus recommends giving your trainer feedback about how you are or aren’t liking the exercises, what is or isn’t working and anything else that’s on your mind. Most often, your trainer will check in with you before and after the workout. So use the opportunity to talk! “You know your body better than anyone else, so speak up at each session and your experience will be that much more enjoyable and exciting,” Faltus says.

7. You’re going to have bad days.
“You’re going to fall off the wagon and have off days at some point,” says Trimble. “But get right back up and begin again without getting discouraged.” The biggest problem trainers see in their clients is that their emotional confidence starts to dwindle when something goes wrong. “You have to believe in yourself and [believe] you can do it,” Trimble says. So, if you splurge on your eating one weekend, don’t beat yourself up—just give it your all during your Monday workout session.

8. If you don’t have a trainer, you can still stay motivated.
On those mornings when you just can’t get yourself out of bed, it’d be pretty nice to have a trainer waiting for you at the gym. But you don’t need a trainer if you know how to find motivation elsewhere. For one thing, Trimble recommends working out with a partner for extra encouragement. He also suggests choosing a fun workout so you’ll look forward to it. “These days, so many programs are easily accessible, such as at-home boot camp workouts, circuit training, online videos and specific plans such as the P90X workout.” And perhaps most important, be consistent. If you exercise on the same days every week, not only can you schedule around your workout, but you’ll be more likely not to miss it.

9. You have to eat right, too.
Personal trainers aren’t miracle workers, so after you leave the gym, make sure you follow the diet plan you’ve established for yourself (or with the help of a dietician). One way Trimble helps his clients eat right is by encouraging them to keep a food journal. “Nutrition can be a problem, so writing it down and being able to look at it with my clients is helpful,” he says. Not only will you be able to discuss what you’re eating with your trainer, but you’ll also become more aware of your food choices—and rethink that second piece of cake! One way Faltus suggests you start a good nutrition plan? Let yourself cheat. “Eating balanced meals filled with fruits, vegetables, grains and protein will prove successful in the long run. But remember to give yourself a ‘cheat’ nutrition day on the weekends.”

10. You’re probably not getting enough sleep.
“Lack of sleep causes a decrease in energy and motivation to accomplish both short- and long-term goals.” Not only are proper sleeping habits important for you mentally, but if you don’t rest your muscles properly before and after a good workout, you risk injury. Faltus says to “adjust your sleep schedule and get both quality sleep and a decent quantity of sleep. You’ll notice the difference in your overall performance, and your muscles will thank you too.” For some tips on how you can destress and unwind before bed to sleep better, click here.

Source: https://bit.ly/35QuewC

Please visit our website and join the waiting list. Our app is coming soon: http://fitradar.me/

5 things a good personal trainer would never do

In every field, there will be a few different ways of doing things. Although other careers will have people doing things differently, all with the end result being positive, there are some things a personal trainer really shouldn’t ever do. When it comes to being a Personal Trainer, some things are non-negotiable as they can lead to injuries, bad experiences for clients and eventually, the loss of a client base for your business. Australian Institute of Fitness Victoria Fitness Coach, Christopher Meggyesy, lays down the 5 things a great Personal Trainer would never be caught doing.

1. LOSE FOCUS

A great personal trainer’s client focus doesn’t ever waiver. There are some Personal Trainers out there that remind me of Dory from Finding Nemo; very easily distracted. Your clients are paying for YOUR time. From the moment you greet your 10:30 client to the moment they leave, the great PT is 100% about their training. Whether it’s fixing technique, handing their client a water bottle, or just being the motivation they need, it’s all about your client. Whoever it is that just walked in the gym, they can wait. If you’re a personal trainer and you are constantly getting tied up with other things, checking your phone or chatting with other people during a client’s session, you may find some clients parting ways with you and finding someone new.

2. DOESN’T PROGRAM

The great PT will have every moment of the training session accounted for prior to beginning the session. It’s pretty obvious when the PT is umming and ahing about what’s next for the client, they’re winging it. A PT should know what is happening at each minute, what will be covered and how to get the best workout completed specific to the client within the time they have booked with them. If a PT seems to be lost, chances are they aren’t really sure of what the client needs in order for them to reach their goals. Remember, those who fail to plan, plan to fail.

3. TRAIN EVERY CLIENT THE SAME WAY

Every client is different, aren’t they? They have each got their own little quirks, health concerns, and movement deficiencies. So why are there so many cookie cutter programs out there? Each program should be tailored to the client’s needs, that’s part of what your client is paying you for. One of the first things a personal trainer should be doing within the first session is asking what a client’s needs and wants are, what their goals are, what they hope to achieve and also ask about the client’s past history with exercise. A PT should understand completely what a client is capable of doing (and not doing) and working on the areas they wish to work on in order to achieve their goals. Because everyone has different goals, everyone’s session should look and feel different.

4. LOOKS AT THEIR PHONE

iPhones, Android phones, Windows phones, even your old Nokia! No matter what the brand, having one in your hand while you’re taking a session, regardless of the intention, just looks like a distraction. You may very well be timing your client with your stopwatch app, but to the outside world and any future clients that may see your session, they can’t tell the difference between timing a client, and swiping right on Tinder. Clients are paying for the time and attention of a trainer for a reason. The best PT’s should ditch their phone for the whole session and their focus directly on the client at all times.

5. DOESN’T WALK THE TALK

Let’s face it, you are your own brand. Prospective clients start forming opinions about you the second they see you. In that first second, how are you marketing yourself? That first second might come when you turn up for your 5:30am client on a Monday morning, and a brand new member to the gym sees you as you walk in the door. Do you look (and smell) like you just rolled out of bed, or do you look clean, neat and tidy with an awesome smile? Ask yourself, who are you more likely to hand over your hard money earned to? Someone who looks and acts like a professional, or the slob that just rolled out of bed? Feeling and looking fit and healthy is going to also rub off on the client’s. A client is going to feel more motivated to get up early and get a great workout completed if their PT looks like they’ve already completed it and are now feeling (and looking) fantastic.

A trainer should be there to help, motivate, assist when needed and provide the right training and fitness advice possible for each and every client. Getting to know a client is a must-have and being able to provide the right workout for each client is a necessity. If you’re a PT and you find yourself doing some of the above things, it may be time to step back and take a look at your role and look at ways you can address them and help your clients to reach their full potential once more. If you’re a client and are noticing some of these “red flags” with your own trainer, it may be time to take a look at other trainers in the area who may be able to help you succeed. 

Source: https://bit.ly/2ou8xkK

Visit our website and join the mailing list! Our app is coming soon:

http://fitradar.me/

Exercise makes you happier than having money

Exercise makes you happier than having money, according to Yale and Oxford research.

  • Researchers at Yale and Oxford may have proven exercise is more important to your mental health than your economic status.
  • The scientists found that, while those who exercised regularly tended to feel bad for around 18 days a year, non-active participants felt bad for 35 days more on average.
  • The team also noticed that certain sports that involve socializing can have more of a positive effect on your mental health than others.

It’s clear exercise has health benefits both physical and mental — but what if we could actually prove it was more important to your mental health than your economic status?

According to a study carried out by researchers at Yale and Oxford, we may have done just that.

In the study, published in The Lancet, scientists collected data about the physical behavior and mental mood of over 1.2 million Americans.

Participants were asked to answer the following question: “How many times have you felt mentally unwell in the past 30 days, for example, due to stress, depression, or emotional problems?”

The participants were also asked about their income and physical activities. They were able to choose from 75 types of physical activity — from lawn-mowing, childcare, and housework to weight lifting, cycling, and running.

Those who keep more active tend to be happier overall

The scientists found that, while those who exercised regularly tended to feel bad for around 18 days a year, non-active participants felt bad for 35 days more on average.

In addition, the researchers found that physically active people feel just as good as those who don’t do sports, but who earn around $25,000 more a year.

Essentially, you’d have to earn quite a lot more for your earnings to give you the same happiness-boosting effect sport has.

That doesn’t mean, however, that the more sport you do, the happier you are.

Too much exercise can be detrimental to your mental health

Exercise is clearly good for you but how much is too much?

“The relationship between sport duration and mental load is U-shaped,” said study author Adam Chekroud of Yale University in an interview with Die Welt. The study found that physical activity only contributes to better mental well-being when it falls within a certain time frame.

According to the study, three to five training sessions each lasting between 30 to 60 minutes per week is ideal.

More than this, however, can have the opposite effect — in fact, the mental health of those participants who exercised for longer than three hours a day suffered more than that of those who weren’t particularly physically active.

The scientists also noticed that certain sports that involve socializing — i.e. team sports — can have more of a positive effect on your mental health than others.

Despite the fact that neither cycling nor aerobics and fitness technically counts as team sports, these activities can also have a considerable positive effect on your mental health.

Source: https://bit.ly/2J66b4H

Please visit our website and join the mailing list. Our app is coming soon: http://fitradar.me/

Collaboration between developers and non-developers in FitRadar

Initially when we worked on the idea of Fitradar several people were involved – among them were sports club manager, designer, and developer. Everyone put his ideas on the table and after several brainstorm meetings we came up with initial requirements for our future product. Later all who participated in user requirement creation became in one or another way a tester. The user requirement authors knew the best how the app should work, so they were the ones who could verify the application’s design and the functionality.

Now when we have a tangible product, the people who laid down the requirements want to make sure their ideas are working properly in the application. Some of the features are possible to test via User Interface, like design and navigation. And in this case a screen is serving as a medium of communication between developers and testers. People who are testing the application can take screenshots and explain the problem to developer in a demonstrable way. But how to make sure the business logic implemented in application is behaving according to the requirements. Developers implemented it according to their interpretation of requirements. Although we used UML diagrams tables and pictures, many times the only way to describe the business logic was a human language. And as we know human language is quite ambiguous and fills the gaps with a lot of assumptions and that inevitably leads to misinterpretation. One way for non developer to test the applications business logic is to try to invoke it from a UI and see if it works correctly, but developers and QA know that in such way we are covering just a small portion of test cases. So there must be a better way for user requirement authors, would it be Quality Assure, Business Analysist or any other team member, to make sure the business logic he proposed is functioning as expected.

I already wrote about the test strategy in our team and well known test pyramid. The lower level tests are written by developers and only time when they need an input from other team members is the time when they are interpreting the requirements. Once the requirements are clear they can write the code and accompanying unit tests. Even UI tests can be written with little help from non developers, but the part where user requirement authors start to play important role is functional tests. In case of our app the UI is separated from the rest of application and most of the business logic happens on the back-end. So the functional tests in our team include back-end API tests and mobile application API tests.

The way how we helped the non developers in our team understand the implanted business logic was by using some principles of the Domain Driven Design and Behavior Driven Development. I should say not everything what Eric Evans described in his book “Domain Language Tackling Complexity in the Heart of Software” was applicable to our solution, but some aspects really helped us to establish a good way of collaboration between team members and today I wanted to share those aspect of DDD:

  • Ubiquitous Language, the term introduces by Eric Evans, helped our developers and the rest of the team speak the same language. The main idea of Ubiquitous Language is to create a common vocabulary of a given business domain that both domain experts and developers would speak. It was quite easy to establish since in the process of creation of user requirements both developers and non developers were present and developers knew quite well the business domain. Most of the value of the common language we started to see when developers had to read their implemented logic to non developers
  • The next step when the vocabulary of app was created, was to create the API methods that non developers are able to understand and follow. In order to achieve this API methods were written on such abstraction level that only domain vocabulary was used – all the technical details were hidden in the underlying classes and methods. Even logical operations were converted in to the methods that expressed the domain concept.
  • Once the API methods were in place, the business logic authors could participate in API review. But even then there might be a flaw in the requirements itself. And so we needed to write tests expressed in domain language. For this purpose we use some aspects of Behavior driven development, particularly we used Cucumber language (Gherkin plugin on Android Studio and SpecFlow extension on Visual Studio) for writing functional and UI tests. Since the Cucumber language is intended to be used not only by developers but by regular humans as well then everyone who contributed to our application’s user requirements was able to add tests as well.

Visit our website and join the mailing list. Our app is coming soon: http://fitradar.me/

Top 10 Benefits of Personal Training

From helping you reach your fitness goals to figuring out how to exercise safely with a chronic condition, learn the top 10 benefits of personal training and why it could be one of the best investments you’ll make in your overall health and well-being.

1. Motivation

Most of us work harder in the presence of others. Having a trainer by your side can provide the encouragement, energy and motivation you need to jumpstart your routine. A trainer can also help you set goals, create a plan to accomplish them and celebrate the day you reach them.

2. Consistency

Do you find it difficult to stick with a program or habit? A trainer can hold you accountable and help you overcome all the excuses you might use to avoid your commitment to exercise. It’s a lot harder to skip the gym when you know someone is waiting for you.

3. Clarity

Fitness can be confusing. There is a lot of information to sort through. Eat this, not that. Cardio before or after strength training? Your trainer can help you find credible information and provide direction on your fitness journey. A trainer can help remove the guesswork so you can put all your energy toward accomplishing your goals.

4. Confidence

The gym can be intimidating. Working with a trainer allows you to become confident with how to perform exercises, use machines and navigate the facility. After a few sessions, you will feel ready to tackle the weight room on your own. Even better, an ego boost during exercise can promote stronger self-confidence and self-efficacy, which can help you stick with your exercise program over the long term.

5. Avoid Injury

If you are new to exercise or find that some movements are painful, it is worth hiring a trainer to be certain that you are moving in a safe and effective way. Taking the time to learn proper exercise technique can improve your results and prevent annoying injuries.

6. Individual Attention

When it comes to fitness, everyone is different. Your unique body mechanics, experience, goals, fitness level, likes and dislikes can guide your trainer in creating a plan that is specific to your needs. With a program that fits, you are more likely to maintain the habit and see results.

7. Sport-specific Training

Do you want to run your first 5K or prepare for a backpacking trip? Looking to shave some strokes off your golf game? Your trainer can design a fitness program specific to your sport, which will improve your performance and reduce your chance of injury during the event(s).

8. Training With Medical Conditions

Exercise is beneficial for preventing or managing many common chronic conditions such as diabetes, heart disease and hypertension. However, exercising with a medical condition requires additional precautions. A knowledgeable trainer with experience training clients with chronic conditions can design a program that ensures your safety and provides a positive exercise experience.

9. Aging Gracefully

Our bodies change as we age. Perhaps the exercises you used to do no longer work with your body, or maybe you’ve stopped seeing results. A trainer can help you adjust or adapt your program as you age, which will allow you to maintain functionality and strength.

10. FUN

Believe it or not, exercise can be enjoyable. A savvy personal trainer can make exercise both effective and fun. Group or buddy training can be a great way to increase enjoyment, make exercise social and attain the services of a trainer for a cheaper rate. And simply working with a trainer who you like and respect can be enough to provide you with more gratification from your workouts.

Visit our website and join the mailing list! Our app is coming soon:

http://fitradar.me/

P.S. Source: https://bit.ly/2ZegcjW

Logging in our application

Any application to some extent is using the logging system. And we are not an exception. We log a lot of information in our Android and iOS applications as well as in our backend server application. But what logs give us, after all, they are not contributing to the application functionality? They might be a part of user requirements, but why would anyone want to invest money and time for the feature that is not used by a user? Let’s explore the purpose of logs in software development and practices developers are applying.

Here are some of the cases where we are using logging in our applications:

  • during development to make it easier and faster spot a bug along the
    • @NonNull and other annotations and code inspection tool Lint
    • unit and integration tests, where we try to cover most of the code execution paths and integrations points. (And I already wrote how we approached the testing in our project)

    we use logs that show as the trace of actions and values that led to a particular bug. But before we started to use logs we had to answer the following questions:

    • where to put log statements on
    • what information to log

    Since a lot of our code is covered by unit tests then there is little reason to log our own code for debugging and test purposes, but where we don’t have control over the values we are processing is:

    • framework lifecycle methods, like onCreate, on ViewCreate, onResume, onPause in Android application. If our code is using the arguments provided by lifecycle method we log these values and assert the expected value if it is possible
    • to click listeners and other event handlers
    • third party library methods and their returned results. For example, for network calls we are using Retrofit and we always log the network requests and responses in debug build variant. Another example calls to the database. Since we are using Room in Android application, we want to see SQL code sent to the database

    So once we log enough information we can spot the bug just by going through logs and skipping the process of starting the app again with attached debugger and stepping through the code. And we don’t have to worry much about the performance as well since Android logging system is taking care of debug log statements and skip them at runtime.

  • in production:
    • to monitor, on the back end server the logs are used to monitor the normal business logic functionality. We log every request. If the request is successful we log it as info, in case request ends up we log error. When the error is reported on the back end service, the gathered logs are of great value. Very often they allow to spot the problem without further investigation.

    • we log fatal errors, that caused the application stop. On the backend server, we catch the exceptions as early as possible and when the exception is caught it is logged and an email is sent to an administrator. We don’t experience many exceptions outside of our app on the back end part, because the only reason that can lead to such exception is a malformed request and not the back end code itself, and since the request is formed by third party library it is very rear that it is malformed. A different story is with uncaught exceptions on the client – Android or iOS app. It is not possible to catch all the exceptions so they leak and cause the app to crash. To log these kinds of exceptions we use Fabric Crashlytics (Firebase). These logs later help us a lot to find a cause of a crash.

Visit our website and join the mailing list! Our app is coming soon:

http://fitradar.me/