From Henna Hair to Natural Gray

monica_pawlan_73x58.jpgAbout five years ago I decided to start coloring my hair. It wasn’t because the gray creeping into my straight shoulder-length dark brown hair bothered me (see photo at left), but because I could no longer get through a job interview and land the job.  I was working in the Silicon Valley tech industry as a technical writer with a long history of successful, technical, and complex projects, but suddenly something had changed. I found myself being asked a bevy of bizarre questions in interviews to make a case to pass me by for someone else, someone who didn’t have gray hair.

So after doing some research I decided to use pure, natural organic henna from Rajasthan to cover my gray and become a redhead. I loved the color and it worked very well with my coloring. The henna hair developed into a burgundy dark red after many henna applications over several months, and even better, I was back to my old ways of acing interviews and landing the job, despite being in my mid to late 60’s.  The secret seemed to be that I just wasn’t gray anymore.

Now, 4 years later, retired, and approaching 70, I’ve decided to go back to my natural gray. I have several friends who have gone back to natural gray, and I think they look fantastic. Gray hair is beautiful.

If you have henna hair and want to get back to gray naturally, you can follow this blog, which I will update as I progress through the steps outlined below.

About Henna

Henna is a permanent color that fades very slowly. I couldn’t just let it all grow out over time because I would have two-tone hair: gray and black on top, and orange on the bottom. When burgundy henna fades, it fades to orange as you use less of it.

At first I considered using a chemical-based, non-permanent color over my hair as it grew out, but Darcy Vasudev owner of Henna Guru in San Francisco encouraged me to stay away from the chemicals.  That wasn’t a hard sell for me because I try to live as cleanly as I can. Also, my hair is very fine and chemicals tend to be very hard on it – drying it out and making it break and frizz.

Important note: You cannot use chemical-based anything (permanent colors, permanent waves, hair bleach, etc.) on henna hair when the henna you use contains metallic salts. The metallic salts interact with the chemicals in horrible ways and ruin your hair. Always use pure henna with no metallic salts. Herbs are fine; just no metallic salts. For more information see Henna for Hair.

This blog chronicles my journey from the first step, which I took on August 8, 2018, to when I reach my final natural gray at some point in the future.  I will update this blog every 2 to 3 weeks as I take each step, and describe any modifications I make to the process along the way.

Strategy

Before I started, I was using 75 grams of henna mixed in about 1 cup of hot chamomile tea.  The herbal tea activates the henna and turns it into a paste, which I applied thickly to my hair and washed out 1 to 2 hours later.

Note: Henna that contains herbs can be mixed with hot water instead of chamomile tea. Henna needs to be mixed with something acidic like black tea, herbal, tea or herbs to activate.

I worked with Darcy at Henna Guru to map out a way to get me from burgundy to natural gray using sliding proportions of henna, cassia, and indigo.  The cassia and indigo activate the henna, so no need to use herbal tea.

We decided to do it like this:

  • Lighten the burgundy/orange tones of the henna by gradually decreasing the amount of henna from 75 gms to 5 gms.
  • Darken the orange tones in the henna by adding a small amount of indigo that I gradually increase as I progress through the steps. As Darcy explains on her site, hair that has a lot of gray, needs some henna to bind the indigo to the hair.
  • Add enough neutral colored conditioning cassia to bulk up the mix so it covers all of the hair without adding color.

I also use Triphala shampoo by SoulTree, as a second wash to my hair after washing out the herbs with my regular shampoo. Triphala shampoo contains shikakai, which is an herb that darkens henna hair.  Interestingly, this shampoo also contains some henna in a lesser amount. Anyway, if you want to tone down the brightness of the henna, I find that this shampoo, and probably any shampoo that contains enough shikakai, helps to do that.

Steps

The goal is to get to where my hair grows out dark from the indigo, with some red highlights from the henna, and beautifully conditioned from the cassia. When I get to the last step, I will maintain that mix until all of the dark red underneath has been cut off. Then, I will stop using the mix and let the indigo and henna fade to gray little by little every time I wash my hair.

Even though henna is a permanent color, it should fade with the the semi-permanent indigo because I use so little henna with more indigo in Step 6. The goal is to have the indigo and henna fade together. We’ll find out how well that works when I get there.

To go from henna hair to natural gray, I changed the mix in the following steps:

1. 50 gms henna, 20 gms, cassia, 5 gms indigo – Completed 8/8/2018
2. 40 gms henna, 25 gms cassia, 10 gms indigo – Completed 8/25/2018
3. 30 gms henna, 30 gms cassia, 15 gms indigo  – Completed 9/9/2018
4. 20 gms henna, 40 gms cassia + 15 gms indigo  – Completed 9/25/2018
5. 10 gms henna, 50 gms cassia + 15 gms indigo  – Completed 10/9/2018
6. 5 gms henna, 55 gms cassia + 15 gms indigo  – tbd
7. Continue Step 6 until all dark henna hair grows out and has been cut off  – tbd
8. Fade to gray  – tbd

Step 1

H2G-Step1.jpg

50 gms henna, 20 gms, cassia, 5 gms indigo

Before doing Step 1, I went to my hair stylist, William Hopper at Custom Hair Styling in San Jose CA, and had him cut off 2 inches from the bottom.

The next day, after completing step 1 (see photo at left), my hair is about the same color, but the roots are a lighter orange/brown (not shown in the photo) that blend nicely with the rest of my hair. It is slightly more brown than burgundy from the addition of the indigo.

IMG_20180816_101245.jpgAfter washing my hair a couple of times over the next week, it is easier to see how my hair is starting to turn brown (see photo at left). At this point it still has some burgundy highlighting, which you can see in the middle of the photo.

The brown color comes from mixing henna with indigo.  You get a nice brown with red highlights.  Also, henna is brightest right after you apply it and gradually fades as you wash your hair. The indigo also slowly fades, which is where I want to  end up with light brown hair with the burgundy color grown out and cut off, at which point I can fade to gray.

Step 2

IMG_20180825_203614.jpg

40 gms henna, 25 gms cassia, 10 gms indigo

Looking a little darker, especially compared to the first picture in Step 1, after applying the Step 2 herbs (less henna and more indigo) to my hair.

Here is how it looks after two hair washings:

IMG_20180905_133546.jpg

Step 3

30 gms henna, 30 gms cassia, 15 gms indigo

Getting lighter with a more even color.

 

 

 

After one washing it is slightly less red (more brown) and a more even color:

Step 4

20 gms henna, 40 gms cassia + 15 gms indigo

Looking underneath you can see that the hair is getting darker with the henna to indigo ratio changing. Light coming in through a window makes the henna red seem stronger than it actually is.

 

 

 

Step 5

10 gms henna, 50 gms cassia + 15 gms indigo  – Completed 10/9/2018

 

Advertisements
From Henna Hair to Natural Gray

Cataract Surgery – My Story

I recently had the lenses in both of my eyes replaced with Intraocular Lenses (IOLs).  I had very thick and dense brown and yellow cataracts by the time I had the surgery because I was having a hard time deciding what kind of IOLs to get.  There are a lot of choices, but no single option completely restores your vision. There are pluses and minuses to every option.

Some people ask how to know when you need to have cataract surgery such that it qualifies for your medical insurance to help pay the expenses. Your optometrist can tell you, or you can visit an ophthalmologist to find out.  One way to know you need surgery is when your optometrist can no longer correct your vision with glasses to get you to a 20-40 correction for driving. Another way is to have your cataracts examined by an ophthalmologist, and if they reach a certain size and/or density or both, it’s time. For most people this happens in their middle to late 70’s. Other people go much longer before they need it, and many people need it much sooner.

Don’t assume that your insurance will pay for everything. Typically, they pay for basic monofocal lenses, the surgery, and put some money towards one pair of glasses if you need them after the surgery.  Currently as of this writing, Medicare does not pay for laser surgery to remove your cataracts, and they don’t pay for any type of lens other than the standard monofocal lens. If you want either of these or both, you pay for it yourself and the costs can be quite high. If you have insurance other than Medicare, it might cover the laser.

Thankfully, my optometrist made the decision of which lenses to get easy for me, as I describe in Here ‘s How I Decided. But first, an overview of the basic IOL choices.

Lense Options

Conventional Monofocal lenses use a single focal point and are typically spherical in shape.  They can be set to any distance you want. Most people choose to have both eyes set to distance and then use reading glasses. Another option is to have both eyes set to near, and then use glasses for driving, for when you need to read something in the distance, or to watch TV if your TV is more than 7 or 8 feet away. Some people choose monovision, which is when you have one eye set to near and the other eye set to far. The brain adjusts and learns which eye to look through depending on the distance. This works about 70% of the time with about 30% of people never fully adjusting.

Premium aspheric IOLs use a single point of focus and match the asherical shape and quality of the natural eye more closely. This means they can provide sharper vision in general, sharper vision in low-light conditions, and sharper vision for people with large pupils. Premium aspheric IOls include toric lenses (astygmatism correction built into the lens) and accommodating IOLs (slightly flexible lenses to make near objects appear sharper). My husband got toric lenses  set to the near-point and loves them because now he only needs glasses for driving.

Multifocal lenses provide two or more focal points by splitting light between distance, intermediate, and near.  Your brain learns to focus only on one distance at a time, and that leaves the blur from the other focal points to possibly cause halos and flare.  These lenses can provide better near vision than accommodating IOLs, but are more likely to cause flares and halos or slightly blurred distance vision as a trade-off.

EDOF-IOLs (extended-depth-of-focus) create one elongated focal point that provides improved near and intermediate vision without the trade-off of blurred distance vision. See Discussion of  extended depth of focus IOLs  and  FDA Update: Next Generation IOLs for more information.

With multifocal  or EDOF IOLs you might not need to wear glasses as much as you might with monofocal lenses, but you might not have the sharpest vision possible and you might also need glasses for reading small print or for driving at night.

Everyone’s eyesight changes as they age because the visual machinery we all have is more than just the lens. So it’s possible to spend a lot of money on multifocal lenses and not need glasses very much for awhile, but have that change as you age.

See Intraocular Cataract Lenses for more information about lens types and options.

Here’s How I Decided

The final decision on lenses depends on your personal visual needs and your lifestyle. It also depends on your budget. Here is one way to determine what that might mean for you.

At my last eye appointment when my optometrist me told it was time because he could no longer correct my vision so I would be legal to drive, I asked how to decide on the lenses. My optometrist started asking me questions. He of course knew that as long as I have needed glasses, it has been for driving only. I have always had good close-up vision. So his questions to me went something like this:

  1. Do you like the vision you have now? (Yes)
  2. Do you like not having to wear glasses for things like reading, cooking, washing, or picking out your clothes? (Yes)
  3. Do you mind wearing glasses for driving, or are you okay with that? (I am fine with just wearing glasses for driving)

So, he said to me, get monofocal lenses set to the vision you have now (I don’t have much astigmatism so I don’t need toric lenses). That would be each lens set to close-up about 18 inches out for where I would have the sharpest focus. I asked if I would be able to use the computer without glasses, and he asked me if I can do that now, and I said yes. So, he said then you would be able to do it after the surgery too because you would be getting the vision you have now.

I asked him what is wrong with multifocal lenses, and he just said, then you won’t have the sharpest possible vision at any distance. (See the discussion of multifocal lenses above to understand why. ) Also, premium, multifocal, and EDOF  lenses are expensive and insurance doesn’t cover them so you pay out of pocket thousands of dollars for each eye. What he was recommending for me would give me the sharpest possible vision near and far (with glasses).

Note: Can’t comment personally about any of the other lenses, but anyone who has them and wants to weigh in in the comments section, please do!

Most people get monofocal lenses with correction for distance. That way you have very good vision after about 2 to 3 ft. from your face all the way out. You get more vision than you do with them set to the near point (like I did) and don’t need glasses for driving, but most people with this setting need glasses for reading and anything else that involves close up details. Basically you have a blur around you at the near point until you put on your reading glasses. Depending on your lifestyle and personality, you might be okay with that or not. Some people don’t even notice it until they try to read something.  But if you spend a lot of time doing close-up things and much less time driving or doing other distance-related activities such as sports, you might prefer the near correction over the distance correction. For example, you might ask yourself, how much would it annoy me to have to put on glasses to read my shampoo bottle in the shower?

glasses-and-chain.jpg
My glasses with a chain I made from an old necklace chain and two necklace clasps that I bought at a crafts store.

I wasn’t okay with the idea of having a close-up blur around me. As an older person, I don’t drive as much as I used to and spend way more time at home doing close-up things and being on the computer.  When I go out for walks, I can see fine even though it’s somewhat blurred in the distance.  I can admire plants, see cars coming, and see down the street. The sunnier the day, the better I see in the distance, and the less I notice the distance blur.

If I want to read a sign or just see details in the distance, I put my glasses on, which I wear around my neck on a chain. It’s a much better lifestyle choice for me to mostly just use glasses for driving.

One thing I’ve noticed is after doing a lot of close-up work, the distance blur  is worse for me than when my eyes are relaxed.  After some minutes as my eyes relax, I am able to see better in the distance.

The Outcome

If you are a myope like me and want to go with near vision, you will need to work with your optometrist and/or ophthalmologist to decide where to set the focus. About 18″ out worked out to be perfect for me. I can read most print unless it’s very, very tiny (then I use a magnifying glass) and I can see and work on the computer just fine.

Right now I have excellent close-up vision that is about 20-20 at the near point, and with my glasses I am about 20-15 or so for distance. Also, if as I age my distance vision gets worse, I can get stronger glasses for the distance and keep driving.  So, if you don’t mind wearing glasses some of the time, you get the sharpest vision at two points with monofocal lenses plus glasses with both eyes set at the same distance (either near or far). If you have a lot of astigmatism, go with toric lenses, which are monofocal lenses with astigmatism correction.
If you go the nearsighted route, you might or might not be able to see the TV. Our TV is about 9 ft. away, and I can see if just fine. It’s not crisp and clear, but I don’t mind that. I can read most of the text on the screen, but not the program guide unless I’m feeling very, very relaxed at which time, the program guide comes in clear enough so that I can read it without leaning forward or walking a few steps closer. If it really bothers me, I can also put my glasses on to read the guide. Black and white and/or subtitled movies require that I wear my glasses.
Also, even though multifocal lenses are known for halos and flare at night, both my husband and I experience them with our monofocal lenses – which are supposed to be better about that. I had considered getting multifocal lenses because I really liked the idea of not needing glasses so much, but I’m glad I didn’t spend $9,000 for both eyes for multifocal lenses because not only would I have likely had more flare and halos than I have now with the monofocal lenses, but given that I have very small pupils, I would have probably always needed to wear glasses for driving at night.  It wouldn’t have been much of an improvement over what I have now and would have cost us a lot of additional money.

The Surgery

The surgery itself is nothing to be afraid of. They had me on a hospital bed under nice warm covers with a cap on my head. They give you drugs so that you don’t feel the surgery and are not aware of anything happening to your eye. You can hear the doctor if he or she says anything or asks you a question, and you can reply, but you don’t feel the surgery. You feel completely relaxed and content.

Cataract Surgery – My Story

An End to Alzheimer’s?

The most interesting book I read in 2016 is The End of Alzheimer’s: A Differential Diagnosis Toward a Cure, which you can get from Real Health Clinics, by Thomas J. Lewis, PhD and Clement L. Trempe, MD.

Note: Another book that was published in 2017 is  The End of Alzheimer’s: The First Program to Prevent and Reverse Cognitive Decline.  It is very worth the read.

The rest of this post provides a very high-level summary of the message in this 482 page book that is packed with research studies, advice, and other information. The real point is that there really is something you can do to keep yourself from getting Alzheimer’s, and if you already have it, there is plenty you can do to stop, reverse, or slow down the progression.

The tips for AD also apply to other similar diseases such as Parkinson’s, vascular dementia, and other forms of dementia.

  • When someone shows signs of Alzheimer’s Disease (AD), it is very important to understand the person’s overall health.
  • Some disease frequently occur at the same time or before AD, such as type 2 diabetes, macular degeneration, glaucoma, and cardiovascular disease.
  • Many conditions have the same symptoms as AD, but can be treated and cured such as head injury, acute infections, hydrocephalus, brain tumors, toxic exposure, metabolic disorders, and others.
  • Many diseases are related to AD or appear with it due to common risk factors and root causes.
  • Every AD patient has a different set of underlying health issues that can show up as an AD diagnosis.
  • Differential diagnosis is key to getting to the root cause of an individual’s symptoms. A differential diagnosis is the process used by doctors to differentiate between two or more conditions that share the same or similar signs or symptoms.
  • Treatments aimed at the underlying disease conditions can make the patient healthier and reduce or remove the symptoms of AD.

Beta Amyloids

The current thinking is that the accumulation of Beta Amyloids in the brain cause AD. However, drugs aimed at removing Beta Amyloids do not help patients with AD in any meaningful way.

More likely the presence of Beta Amyloids indicates that a deeper underlying health problem exists. Some researchers have concluded that our bodies produce Beta Amyloids as an immune response to hostile microorganisms.

In all likelihood, Beta Amyloids are one biomarker for AD among others.

Inflammation

Inflammation is the body’s first line of defense against toxins, infections, and injuries. Chronic inflammation is when the body’s inflammatory response goes on too long and causes damage to the heart, brain, and other organs and cause diseases like cardiovascular disease,  cancer, and Alzheimer’s Disease. smoking, obesity, chronic stress and drinking alcohol excessively can cause chronic inflammation.

Lifestyle imbalances create chronic inflammation, which causes diseases, and in turn more disease. Chronic inflammation weakens our immune systems. New research points to inflammation as playing a major role in AD, and suggests that targeting inflammation can help to prevent and even cure AD.

Cardiovascular Disease

Cardiovascular disease generally refers to conditions that involve narrowed or blocked blood vessels that can lead to a heart attack, chest pain (angina) or stroke. Other heart conditions, such as those that affect your heart’s muscle, valves or rhythm, also are considered forms of heart disease. 
                                                                                               — The Mayo Clinic

Cardiovascular disease reduces cerebral blood flow (CBF), which worsens the vascular stability of the brain. This can cause or worsen cognitive problems. Risk factors for cardiovascular disease such as high blood pressure and diabetes are also risk factors for Alzheimer’s disease.

Diabetes

Type 2Diabetes is a risk factor for Alzheimer’s disease. Diabetes is a type of metabolic disorder that is now believed to be caused by inflammation. Insulin resistance in the brain triggers AD.

Many researchers have started referring to Alzheimer’s Disease as Type 3 diabetes because insulin deficiency and insulin resistance lead to a type of neurodegeneration that is common to AD.

Eye Diseases

The retina is an extension of the brain, and examining the eye can uncover the very early signs of changes in the brain – changes that can lead to Alzheimer’s Disease. Early diagnosis can lead to making appropriate lifestyle changes early enough to prevent or stop the progression of, or reverse the disease.

The following list of eye diseases shows how they are associated with chronic disease. This list is reproduced from The End of Alzheimer’s: A Differential Diagnosis Toward a Cure:

Nuclear cataract: Associated with increased risk of cardiovascular disease.
Cortical cataract: Associated with Alzheimer’s disease.
Glaucoma: Now considered Alzheimer’s disease of the eye.
Macular degeneration: Those with this disease are at increased risk of both cardiovascular disease and Alzheimer’s.
Loss of visual acuity: Sudden or steady vision loss is associated with increased risk of all cause mortality.

Lifestyle Changes

You can start right away with the lifestyle changes listed below that can get chronic inflammation under control. Through diet and exercise, you can start to build up your immune system so you cure, reduce, or never get chronic inflammation.

!! You can also get in touch with RealHealth Clinics for testing and individually targeted advice for your particular situation.

  • Avoid high carbohydrate diets and increase essential fatty acids. See Top Ten Foods Highest in Carbohydrates. high carbohydrate foods are sugary cereals, crackers, cakes, flours, jams, preserves, bread products, refined potato products, and sugary drinks. Healthy high carbohydrate foods include vegetables, legumes (beans), whole grains, fruits, nuts, and yogurt.
  • Reduce high glycemic food intake: avoid sugar, and increase fat
  • Get anti-oxidents from green leafy vegetables, don’t supplement
  • Eat diverse foods that are fresh and have a lot of minerals and vitamins
  • Eat cheeses, cold water fish, fermented foods, yogurt, and a reasonable amount of salt (for iodine)
  • Make sure you are not Magnesium deficient
  • Make sure you get enough Vitamin D.
  • Increase essential fatty acids (EFA), which are the omega-3 and omega-6 fatty acids found in plant foods. Omega-3’s reduce inflammation and Omega 6’s promote inflammation when eaten excessively. You need both, just be care not to eat an excess of the Omega -6’s.  See Top 10 Foods Highest in Omega 6 Fatty Acids.
  • Get periodontal disease under control.
  • Keep your gut bacteria in balance
  • Exercise regularly.
  • If you smoke, stop.
  • If you have high blood pressure, get it under control
  • Blood pressure lowering drugs reduce blood flow to brain, find out why you have high blood pressure and deal with the problem
  • Many studies indicate that elderly people with calcified and stiff vessels that a blood pressure of 150/95 is not a risk for AD, but probably helps get blood flow to the brain.
  • Don’t take proton-pump inhibitors
  • Don’t take statins — your brain needs cholesterol
An End to Alzheimer’s?

Yoga for Thinning Bones

Two years ago, I started on a journey to improve my bone density with yoga. The results are in, and yes, I did in fact improve my bone density. Following is the whole story.

Bone Density

Bone density is measured with a DEXA scan, which is an x-ray of certain areas of the bones in your body. Because osteoporosis and osteopenia progress slowly, these tests are usually done every 2 years for women 65 and oder and men 70 and older. At least that’s when the insurance starts paying for the scans unless there is a mitigating circumstance that causes a person under those ages to need the scan or to need it more often. If your insurance won’t pay, you can always get the scan and just pay for it. It’s not *that* expensive, and some places do it fairly cheaply.

My last DEXA scan was October 3, 2014, where I found out that I have osteopenia. Osteopenia is the precursor to Osteoporosis. It means your bones do not have “normal” density, but you are not quite bad enough to call it osteoporosis and end up having to take those awful drugs with terrible side effects (which I won’t take).

The “normal” density is between +1 and -1 on the DEXA T-scale. Normal is defined as the bone density of 30-year-old “healthy” white women. Right there, I would say the scale has flaws, because that normal is probably not normal for a naturally small woman, who might never have “normal” bone density on that scale. Smaller people don’t fall as far or take as much weight with them, so their naturally smaller bones might be just fine even if they don’t register as “normal” according to the standard DEXA scan.

First DEXA Scan

In 2014, my doctor ordered the DEXA scan for 2 areas: my lumbar spine and the femoral neck because these are the bones that carry most of the body’s weight. At that time my T scores were -1 (lumbar spine) and –2.3 (femoral neck). A diagnosis of osteoporosis starts at -2.5 so my femoral neck was very close to dropping into the osteoporosis diagnosis. Osteopenia starts at -1 so I was just starting to lose bone density in my lumbar spine.

That same week, I went to see my chiropractor who told me about a woman she knows who does yoga and has maintained her bones that way. When I went home, I searched the web and found Dr. Fishman who had been and continues to be conducting studies on how yoga can improve bone density. I got in touch with him and joined his Yoga for Osteoporosis study.

Second DEXA Scan Two Years Later

This time after 2 years of yoga, my T scores are .6 (lumbar spine, normal) and -2.1 (femoral neck, a little better). I was hoping for a better T score for my femoral neck, but improvement is improvement, and just means I should keep at it. The effects of the yoga are cumulative, and I could eventually over the years get that score to normal or close to it if I keep going with the yoga.

Bone Quality

There is also another measure called bone quality. I haven’t done anything with this, but Dr. Fishman says that bone quality is even more important than bone density. Thin, high quality bones are much less likely to break than “normal” bones that are brittle (poor quality). He has started studying this as well, and apparently, there is a way to measure it. He says that he is finding that yoga helps your body create high-quality bones. 

Hopefully, over these past 2 years my bones have also increased in quality! I’m not participating in the bone quality studies he’s doing.

The Yoga Poses

The osteoporosis study is with specific poses – a sequence he developed that works your spine. I don’t think that just doing a lot of yoga will have the same effect so it’s important to do the specific poses and to do them regularly (at least 4 times a week) and correctly by working with a teacher and attending classes.

I’m sure the first year (at least) of my setting out to improve my bones with yoga, I was not doing the poses correctly. I believe that’s true even though a friend and I paid for 2 private sessions with a yoga teacher (Jito Yumibe) at the Iyengar South Bay yoga studio. Jito got us on the right track, but it was when I started attending regular classes at the studio with Jito and later with Linda Bostrom that I really started to understand how the poses are supposed to be done, and how to get the maximum benefit from my practice at home. It’s something that just takes time and repetition to learn and continue to learn.

This past year (or so) of attending classes and applying what I was learning to my home practice is probably why my bones improved. I’m sure the first year was beneficial, but not as much. Perhaps over the next 2 years, I will see even more improvement in my femoral neck and maintain the improvement in my lumbar spine as I continue to improve and advance in my yoga practice.

More Information

See http://manhattanphysicalmedicine.com/dev/ for more information about what Dr. Fishman is up to with yoga.

You can find out what the poses are, see study results, and watch a video of how to do the poses here: http://manhattanphysicalmedicine.com/dev/?page_id=70.

Yoga for Thinning Bones

Android Studio: Develop the Application

This post is a follow on to Android Studio Getting Started. It explains how to localize text, change the default HelloWorld! text, add a button, and add a second action that defines what happens when the user clicks the button.

  1. Localizable Strings (String Theory)
  2. Change the Default Text
  3. Add a Button
  4. Add a Second Activity
  5. Provide Main Activity Button Action
  6. Fix Package Import Errors
  7. Run the Application
  8. Reference: Full MainActivity.java Code

1. Localizable Strings (String Theory)

The strings.xml file in your project enables you to define your application-specific string resources in one file. You reference the string resources to associate application text with user interface elements. Keeping string resources in a separate file enables you to reference all of your text strings from one place, and to easily hand this file to the localization team for translation.

Strings.xml

To view the strings.xml file:

  1. Switch the left panel to Project view.
  2. In the left panel under app > src > main > res > values locate the strings.xml file and double-click to open it.
  3. Note that there are two string resources already in there, app_name and action_settings. These string resources were added when you created the project.
<resources>
    <string name="app_name">MySimpleApp</string>
    <string name="action_settings">Settings</string>
</resources>

The app_name resource is the name you provided when you created the project and named it MySimpleApp. The action_settings resource is the name of a stub Settings menu provided in the default project. In Section 7. Run the Application, you can see a screen shot of the app with the Settings menu stub displayed.

Find Usages

You can easily find where any resource, widget, variable, class, and so on is used in Android Studio.

  1. In the open Settings.xml file, highlight what you want to find and Press Alt + F7, or in the action_settings line, right-click anywhere on the line.
  2. In the Find Usages panel, look for a gray bar that highlights where the action_settings resource is used.
  3. Double-click the highlighted line:
    8 android:title=”@string/action_settings”. This opens menu_main.xml in Android Studio.
  4. In menu_main.xml with the Design tab in the lower-left corner selected, you can see the string Settings in the top-right area of the design below the MySimpleApp app_title.

2. Change the Default Text String

The default application from Android Studio Getting Started has one text string: Hello World! The following steps explain how to internationalize and change the Hello World! string text. Internationalization is a two-step process:

  1. Add string resources to strings.xml
  2. Use @string/<string resource> notation within the app to reference the string resources in strings.xml

Add String Resource

Add the following resource to strings.xml:

<string name="simple_app">I am a Simple App!</string>

Reference the String Resource

Reference the simple_app string resource from a TextView widget as follows:

  1. Click the content_main.xml tab.
  2. Select the Design button in the lower-left corner.
  3. Select and drag Hello World! from the upper-left corner of the design to the center.
  4. With the Hello World! text selected, locate the Properties panel.
  5. Enter textView for the ID.
  6. Below under the TextView heading in the Properties panel type @string/simple_app into the text field and tab out of the field. This references the simple_app string resource, which changes the text.

    Screen Shot 2016-09-15 at 8.19.43 AM.png
    Put the @string notation in the text field under TextView as shown.
  7. Select  the Text button to display the xml form of content_main.xml.
  8. In the android:text line, you should see @string/simple_app:

content_main.xml:

If you don’t see an @ sign on the android:text line, single-click inside the quotes.

<TextView
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_centerVertical="true"
    android:layout_centerHorizontal="true"
    android:text="@string/simple_app" />

3. Add a Button

In this section you add a Next Page button to the I am a Simple App! screen that takes the user to the second page of the application.

ADD STRING RESOURCE

Add the following resource to strings.xml:

<string name="next_page">Next Page</string>

Reference the String Resource

  1. Click the content_main.xml tab.
  2. Select the Design button in the lower-left corner.
  3. In the Palette menu, find Button (under the heading Widgets).
  4. Click and drag the Button below your I am a Simple App message and center it.
  5. With the button selected, find the Properties menu and in the TextView section for the text field type @string/next_page, and tab out of the field.
  6. Check the ID field at the top of the Properties menu, and if you do not see button in the ID field, enter it and press Tab. In Section 5, you add code that uses the button ID to define the action for this button.

content_main.xml:

If you don’t see an @ sign on the android:text line, single-click inside the quotes.

<Button
    android:text="@string/next_page"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_marginBottom="72dp"
    android:id="@+id/button2"
    android:layout_alignParentBottom="true"
    android:layout_centerHorizontal="true" />

The at sign (@) is required when you are referring to any resource object from XML. It is followed by the resource type (id in this case), a slash, then the resource name (next_page).

The first time you create a resource, put the plus sign (+) before the resource type. When you compile the app, the SDK tools use the ID to create a new resource ID in your project’s R.java file that refers to the EditText element. You do not need to add a plus sign for concrete resources such as strings or layouts. The R.java file is here:

MySimpleApp > app > build > generated > source > r  > debug > com.example.mysimpleapp.test > R

Resource Objects

A resource object is a unique integer name that’s associated with an app resource, such as a bitmap, layout file, or string.

Every resource has a corresponding resource object defined in your project’s R.java file. You can use the object names in the R class to refer to your resources, such as when you need to specify a string value for theandroid:hint attribute. You can also create arbitrary resource IDs that you associate with a view using theandroid:id attribute, which allows you to reference that view from other code.

The SDK tools generate the R.javafile each time you compile your app. You should never modify this file by hand.

For more information, read the guide toProviding Resources.

The plus sign (+) before the resource type is needed only when you’re defining a resource ID for the first time. When you compile the app, the SDK tools use the ID name to create a new resource ID in your project’s R.java file that refers to the EditText element. With the resource ID declared once this way, other references to the ID do not need the plus sign. Using the plus sign is necessary only when specifying a new resource ID and not needed for concrete resources such as strings or layouts. See the sidebox for more information about resource objects.

4. Add a Second Activity

When the user clicks the Next Page button, the second activity displays. It has two string resources: the second activity name and the message that displays to the user.

ADD STRING RESOURCE

This is the message that displays on the second page when the user clicks the Next Page button. Add the following resource to strings.xml:

<string name=”second_page_message”>I am the Second Page!</string>

Create Second Page

The second page is a second activity component.

  1. Towards the top of the project’s file system tree, right-click app.
  2. In the drop-down menu, select New > Activity > Basic Activity.
  3. Change the name of this activity to SecondActivity and click Finish. Android Studio creates the following files: SecondActivity.java, activity_second.xml, and content_second.xml. Also, Android Studio adds the following string resource to strings.xml:
    <string name="title_activity_second">SecondActivity</string>
  4. Navigate to app > src > main > res > layout  and double-click content_second.xml to open it.
  5. Click the Design button in the lower-left corner.
  6. In the Palette under Widgets, drag a TextView to the center of the layout.
  7. With the Text View selected, find the ID field in the Properties menu, and note that it is set to textView2 to distinguish it from the TextView in content_main.xml.
  8. With the Text View selected, find the text field in the Properties menu, and type @string/second_page_message.
  9. Click the Text button to view the XML version of content_second.xml.

content_second.xml:

If you don’t see an @ sign on the android:text line, single-click inside the quotes.

  1. <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:id="@+id/textView2"
        android:text="@string/second_page_message"
        android:layout_centerVertical="true"
        android:layout_centerHorizontal="true" />

5. Provide Main Activity Button Action

Now that you have a button in the main activity, you need to go to MainActivity.java and implement the button’s behavior.

  1. Open MainActivity.java.
  2. Find the onCreate method and add the following code to the end of it.This code adds the Button as part of the initial layout when the app displays.
    Button button = (Button) findViewById(R.id.button);
    button.setOnClickListener(new View.OnClickListener() {
      @Override
      public void onClick(View v) {
    //This line is red to indicate an error until you add the
    //launchSecondActivity method in the next step.
        launchSecondActivity();
      }
    });
  3. Add the following method to the end of the MainActivity class. This method provides the implementation of the launchSecondActivity method called in the button’s onClick method.The launchSecondActivity method creates an Intent object for SecondActivity. The code uses the Intent object to start the second activity. An intent describes an action to perform on an activity. See Intents and Intent Filters and Common Intents.
    private void launchSecondActivity() {
      Intent intent = new Intent(this, SecondActivity.class);
      startActivity(intent);
    }

For reference, the full MainActivity.java code is provided in Section 8:

6. Fix Package Import Errors

When you added the additional code to MainActivity.java, Android Studio flagged some missing imports. To remove the import errors, you can either press Alt + Enter (or Option + Return on Mac) to import the missing classes, or you can set Android studio to add the imports as you work, as follows:

  1. Select File > Other Settings > Default Settings.The  Default Preferences screen displays.
  2. On the Default Preferences screen under Java, set the options as follows:Insert Imports on paste: All
    Show import popup: Checked
    Optimize imports on the fly: Checked
    Add unambiguous imports on the fly: Checked
    Show import suggestions for static methods and fields: Checked

Click Apply and OK.

Android Studio adds the missing imports. For reference, the following is the complete import list for this app:

import android.content.Intent;
import android.os.Bundle;
import android.support.design.widget.FloatingActionButton;
import android.support.design.widget.Snackbar;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.Toolbar;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.widget.Button;

7. Run the Application

  1. Select Tools > Android > AVD Manager.
  2. In Your Virtual Devices, do one of the following:
    1. Under Actions, select an existing virtual device by clicking the green arrow.
      or
    2. At the bottom of the screen, click Create Virtual Device and walk through the screens.
  3. Select Run > Run app. MySimpleApp displays in the emulator.
  4. Click the button to go to the second page in the second activity.
  5. Click the left arrow at the bottom-left of the emulator to return to the main activity.
Screen Shot 2016-09-08 at 8.03.03 AM.png
MySimpleApp running in the emulator with the Settings menu stub displayed

Note: If any of the text is incorrect, go back to content_main.xml or content_second.xml and verify that you put the @string notation into the correct text field.

8. Reference: Full MainActivity.java Code

package com.example.mysimpleapp;

import android.content.Intent;
import android.os.Bundle;
import android.support.design.widget.FloatingActionButton;
import android.support.design.widget.Snackbar;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.Toolbar;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.widget.Button;

public class MainActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
        setSupportActionBar(toolbar);

        FloatingActionButton fab = (FloatingActionButton) findViewById(R.id.fab);
        fab.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                Snackbar.make(view, "Replace with your own action", Snackbar.LENGTH_LONG)
                        .setAction("Action", null).show();
            }
        });
        Button button = (Button) findViewById(R.id.button);
        button.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                launchSecondActivity();
            }
        });
    }

    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        // Inflate the menu; this adds items to the action bar if it is present.
        getMenuInflater().inflate(R.menu.menu_main, menu);
        return true;
    }

    @Override
    public boolean onOptionsItemSelected(MenuItem item) {
        // Handle action bar item clicks here. The action bar will
        // automatically handle clicks on the Home/Up button, so long
        // as you specify a parent activity in AndroidManifest.xml.
        int id = item.getItemId();

        //noinspection SimplifiableIfStatement
        if (id == R.id.action_settings) {
            return true;
        }

        return super.onOptionsItemSelected(item);
    }

    private void launchSecondActivity() {
        Intent intent = new Intent(this, SecondActivity.class);
        startActivity(intent);
    }
}
Android Studio: Develop the Application

Android Studio Getting Started

With Android Studio you can create apps for smart devices that use the Android operating system, such as: phones, tablets, wearable devices, TV, Auto, and Glass. To get started quickly, complete this simple tutorial that was written with the following software:

  • Android Studio 2.1.3.0 for Windows
  • jdk1.8.0_45.

Follow these steps to build and run a simple Android mobile app that displays Hello World! in an emulator:

  1. Get Started
  2. Create an Android App
  3. Display Full Project Structure
  4. Understand Application Components
  5. Run the Default App
  6. Restore Default Layout
  7. Develop the Application

1. Get Started

  1. Download and install Android Studio.
  2. If you get an installation error that Android Studio does not point to a valid JVM, update your JAVA_HOME environment variable to point to your JDK installation. See this page on Stack Overflow for tips.

2. Create an Android App

  1. Open Android Studio.
  2. Select Start a new Android Studio project.
  3. In the Create New Project window, enter:
    Application Name: MySimpleApp
    Company Domain: example.com.
    Package Name: Android Studio generates the package domain from the application name and the company domain. When you enter  the application name, the package name displays as .mysimpleapp. As you type the company domain, Android Studio forms the full package name by appending the letters one-by-one starting before the period in .mysimpleapp and going left so that you have com.example.mysimpleapp.
    Project Location: indicates the directory on your hard drive that holds the project files. This location was determined when you installed Android Studio. This is an editable field, and you can change the location before you proceed.
  4. Click Next.
  5. In Target Android Devices, leave Phone and Tablet selected. Do not select anything else.
  6. Click Next.
  7. In Add an Activity to Mobile, select Basic Activity.and click Next.
  8. In Customize the Activity, click Finish to accept the default name fields for this activity. Android Studio takes a minute or so to open and display the MySimpleApp project.
as-initialscreen
Android Studio and MySimpleApp when Android Studio first starts up

The left panel displays a flattened project structure. The right panel displays two tabs containing the following opened files: MainActivity.java and content_main.xml. The content_main.xml tab is open and, among other things, has an emulator that displays the default Hello World! message.

  1. MainActivity.java contains the Java code that presents the user with a user interface.
  2. content_main.xml file contains layout information for what is displayed to users. Initially this file contains general sizing and padding settings and a TextView widget for displaying text to the user. The default TextView text setting is “Hello World!”.

The left panel under app > res > layout > shows activity_main.xml (in addition to content_main.xml). The activity_main.xml file contains layout information for global and default interface elements such as the app bar, Summary menu stub, and a floating action button. It also contains an include for content_main.xml, which is where the layout information for application-specific user interface elements such as buttons, text view, and text edits resides.

 

3. Display Full Project Structure

The flattened project structure representation on the left does not reflect the actual project structure on the disk. To make them match, do the following:

  1. Locate the drop-down menu below MySimpleApp.When a project first opens after you create it, this menu displays Android.
  2. On the drop-down menu, select Project.

4. Understand Application Components

An activity is an application component that is a single screen with a user interface for doing something such as playing a game or reading a menu. When you create a phone or tablet project, you start with the default activity, edit the default activity as needed, and add more components as needed. The list of application components includes activities, intents, intent filters, services, content providers, app widgets, processes, and threads.

See Introduction to Android.

5. Run the Default APP

In this step, you will run the default app on the emulator. To do this, first you create an Android Virtual Device (AVD) definition, and second, you run the app.

Create AVD

  1. In Android Studio, select Tools > Android > AVD Manager.
  2. In the Your Virtual Devices screen, click Create Virtual Device in the bottom-left corner.
  3. In the Select Hardware screen select Nexus 6.
  4. Click Next.
  5. In the Recommended tab on the System Image screen, choose the top system image.My screen shows the following on the top line. Just pick the top one if your installation shows different images.
    Release Name: Marshmallow
    API Level: 23
    ABI: x86
    Target: Android 6.0 (with Google APIs)
  6. Click Next.
  7. In the Android Virtual Device (AVD) screen, take a look at the settings, and then click Finish.

Run the App from Android Studio

  1. Select the MySimpleApp project and click Run.
  2. In Select Deployment Target, select your emulater and click OK.
    It takes a minute or so for the emulator to display with the app.

About the App

When you created the project, you selected Basic Activity instead of Empty Activity. The default differences between a basic activity and an empty activity are the following:

Basic Activity defaults:

  • Has a Settings menu stub and a floating action button (pink mail icon) on the first page.
  • Has a content_main.xml file in addition to the activity_main.xml file.
  • Uses a relative layout (see Layouts).

Empty Activity defaults:

  • Has only the activity_main.xml file.
  • Uses a linear layout (see Layouts).

 

defaultapp

Settings Menu Stub

Click the three vertical dots in the upper-left corner to display the Settings menu stub. You can see the layout for the Settings menu stub in:

app > src > main > layout >  menu > menu_main.xml:

<menu xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    tools:context="com.example.mysimpleapp.MainActivity">
    <item
        android:id="@+id/action_settings"
        android:orderInCategory="100"
        android:title="@string/action_settings"
        app:showAsAction="never" />
</menu>

Pink Floating Action Button

Click the pink floating action button in the lower-right corner. A message displays telling you to “Replace with your own action.” You can see the settings for the floating action button in: 

app > src > main > layout > activity_main.xml:

<android.support.design.widget.FloatingActionButton
    android:id="@+id/fab"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_gravity="bottom|end"
    android:layout_margin="@dimen/fab_margin"
    app:srcCompat="@android:drawable/ic_dialog_email" />

You will learn more about these files in Android Studio: Develop the Application.

6. Restore Default Android Studio Layout

If you have been experimenting with Android Studio, you have probably noticed you can change the layout quite a bit. If you want to get back to something close to the layout you saw when you first installed and opened Android Studio, do the following:

  1. Select Window > Restore Default Layout.
  2. If the project structure isn’t showing, click the vertical 1: Project on the far left.
  3. Open the MainActivity.java and content_main.xml files.
  4. Set the drop-down menu under MySimpleApp to Android.

7. Develop the Application

See Android Studio: Develop the Application for a follow-on to this posting that adds a button and a second page to the application.

Android Studio Getting Started