jay's old blog

this blog will be deleted soon - please visit my new blog - https://thesanguinetechtrainer.com

Project TD - Day 41 update – Core Tech For The First Batch of APIs for the API Engine


[Ongoing series of blog posts to inform potential developers, users and (hopefully investors) about this new app ecosystem I am architecting, designing, developing and deploying. More details at this page]

Earlier, I have written extensively about the design technique that I plan to follow to build the API Engine. The API Engine itself is a collection of APIs. For the last few days, I have been analysing the APIs that will make up the first batch of contribution towards the engine. I noticed that there are some essential tech components that they need to use to make it work.

Going by the design that I put in place, this is the second bubble from the API design titled as ‘Identify all Tech’.

So, here is the full list of tech’s that are identified to make this happen. The blog post image above lists it.

  • Build and Deploy an API
  • POST and GET to the API
  • PUSH and PULL from the API to the Data Service
  • Google Maps API on Android, Web and iOS
  • Facebook Login API on Android, Web and iOS 

I will of course, follow the design plan, and repo the above stuff, tutorial it. After that (these steps will take a few weeks to complete), I will finally have some serious unit testing to work upon.

As they say in the good books (mostly, there are no good books that I refer to. It simply me using them as proxy :P), exciting times lie ahead!

Follow me on twitterfacebook and instagram for more updates. Thanks

Xiaomi makes its own SOC, so does Samsung Huawei and of course Apple



There is a truck load of money in mobile hardware and the proof is the thick, hard core battle that is still raging among the many, many makers of Android phones.

What makes mobile phones different (like how they are always ‘awake’ unlike say a PC) is what is under the hood. PCs are powered by a Motherboard to which a lot of things like Processor, slots, wireless card, Bluetooth card, sound card, power supply socket and so on are available. That is why we tend to use the word ‘assembled PC’ or ‘off the shelf PC’. That is also why PC hardware enthusiasts exist (but there are no mobile hardware enthusiasts exist, at least not amongst the tech crowd) because it is possible swap out and swap things in. This is also why PCs cannot be ‘awake’ like how phones.

So, unlike PCs, mobile phones have under the hood, what is called as ‘System On Chip’ or SOC. As the name indicates, a SOC has everything (except for RAM and hard drive) already plugged into it. In most cases, the RAM and HDD is probably sealed on to the SOC by the phone manufacturer. That would explain why you cannot just upgrade the RAM on your phone, like how you would on the PC. Thanks to a tight integration, SOCs manage to improve power efficiency and make everything work real smooth. Less nuts and bolts equals less replicability but also more efficiency. Thank god for SOCs because I cannot imagine mobile phones being awesome as they are now without them.

While all this is good, there is a small problem. At least for the phone makers. The big dog in SOC making is of course Qualcomm. As mobile phones have grown in popularity, so has Qualcomm revenue, with they are now big enough take on companies such as Intel. This causes a lot of problems for phone manufacturers their fortunes are tied to what Qualcomm can do. Good or bad, this did not happen with the PC market. Probably because, the PC market was fairly well divided. In terms of processors, there was Intel and AMD. Motherboard manufacturers were like so many. Wireless chip makers were so many. Power supply makers were so many. The power, so to speak, did not rest in one hand.

With SOC, a lot of things are welded in. The SOC maker, hence, wield a lot of power. Qualcomm is already pretty big and it can only get bigger as the android market grows. Of course, a company like Qualcomm would continue to innovate and add new features because alternates are readily available, but again, Qualcomm is big because they make excellent SOCs. There is that.

Other than the ‘being held hostage’ scenario, there is another problem. A problem that android makers suffer from greatly. That has to do with being unable to differentiate themselves. With the kind of maturity that we see in the android market, despite being a tech guy, I myself wonder what exactly is the difference between a mid-range phone and a high-end phone.

The phone I have right now, Oppo F1, meets all my needs and it only cost 15000 bucks. It runs all my productivity apps and it helps me take great pictures, and social apps like Instagram compress the photos to such an extent that all photos look like they were taken by a 5-megapixel camera from the late 2010s. A slightly more expensive phone that I might want to buy is OnePlus 3, and then there is the Galaxy S7 and then the Pixel phones by Google.  I like expensive things, but I am unable to justify the purchase of a more expensive phone because I am unable to tell the difference between a basic Oppo F1 and a OnePlus3 or S7 or Pixel. Sure, a more expensive phone means bragging rights, and I could show off. However, there are other things you can use to show off, and a phone is hardly the device to brag about.

All in all, mobile manufacturers are struggling to tell their customers, why their phone is different from the others. That is where SOCs come into the picture. The SOC will allow – to some extent – certain unique features to be included with the phone. It could allow better integration of digital assistants, better power saving features, better photo taking, hardware customizations. A combination just might allow phone makers to differentiate them from each other. It will also save licensing fees that needs to be paid to Qualcomm, and also reduce the power that Qualcomm might wield if everything is buying matchsticks from them.

This is perhaps why Xiaomi is following along the footsteps of Samsung and Huawei. Samsung has its Exynos SOC (which powers a huge percentage of the Galaxy S7 phones they sell, and almost all phones sold in India are Exynos driven and not Qualcomm powered), Huawei has its Kirin series of SOC. Obviously, Apple has its own ‘A’ series of SOCs. Given these reasons, it is good that Xiaomi is hedging its bets in a meaningful way. I have had mixed experiences with Xiaomi and I hope they fix their supply chain issues (it’s almost impossible to actually buy a Xiaomi product when you want it. I don’t know how a company like this can survive with such an inefficient supply chain) so they can actually compete in the big league. They have a good design team, and talented engineers. I wish them all the best.

Follow me on twitter, facebook and instagram for more updates. Thanks!

Supported Platforms – End Users



[Ongoing series of blog posts to inform potential developers, users and (hopefully investors) about this new app ecosystem I am architecting, designing, developing and deploying. More details at this page]

An ecosystem is worthless if people cannot use it on the platform of their choice. A few years ago (like say 2 years ago) deciding on the supporting end user platforms was tricky. The major platforms were windows desktop, windows touch enabled stuff – windows 8 and windows 10, then there was windows phone, the web browser on desktop, the web browser on mobiles, the web browser on tablets, and then of course android on phone, android on tablet and lastly, ios on phone and ios on tablets.

Phew! That is a lot of platforms. That would drive any developer crazy! It sure did drive me crazy.

Today, and during the year in which this blog post was written, I would say the tech revolution has reached its satisfactory conclusion. That’s good because, now things are simpler. As I continue my work on project TD, I must confess that life is a lot simpler now. With that knowledge, I know now that to reach to the widest audience, I only have to reach out to the following three platforms – Web Browser on desktop, android on phone, and iOS on phone.

Web Browser on desktop

At the end of the day, any machine with a keyboard plugged into it can run a web browser. I recently wrote about the appeal of web development. Web browsers have reached that maturity where they can support full-fledged applications. They also work well with touch enabled devices. A few years ago, I would have no choice but to build a traditional windows desktop application, the touch enabled and so called ‘modern’ or ‘metro’ apps for windows 8 / windows 10, and do the same for Mac and Linux.

Now, I don’t need to target any of these desktop platforms with native apps. The browser based app will take care of all this. Imagine the amount of effort I am able to save here. More importantly, we are now entering an era where a lot of people no longer think running applications in a browser is odd or weird. For someone who grew up in the 90s and early 00s, not using native desktop applications is odd. However, for those who grew up in the late 00s and onwards, using web app comes naturally. That means, having zero native apps will not hurt my ecosystem if it should go wide.

Android and iOS on phone

Intentionally, I have decided to leave out tablets entirely out of the picture. Perhaps, five years ago, we thoughts that tablets might go mainstream and even replace PCs and smartphones. Unfortunately, that did not happen, and I pretty much concluded my own observations in this post. Just this morning, I found out that the iPad version of the Instagram app is but a blown up iPhone app. This does not imply that a large company such as Instagram is lazy. On the contrary, it is a reflection of reality. Tablets are not a major platform and any time/money spent on it is not going to give returns.

Besides, phones have been getting bigger and have become ubiquitous. Thanks to improving infrastructure, it is not that expensive to download apps anymore. Phones also have better SD card support now, and most of them come with decent onboard storage as well. All in all, the mobile platforms have achieved a certain maturity which I should exploit.

Previously, I was of the opinion that I don’t wish to touch iOS. I assumed that developing for the apple platform can be pretty expensive. I also assumed that there are very few iPhones running around. However, I re-did some research, and see if perhaps the passage of time has changed the situation. I found out that at least some things have changed. A cheap Mac and a cheap iPhone can be obtained at prices slightly more than android development gear. The developer license continues to be expensive but that is a business cost. Further, I noticed that there are a small chunk of folks who are indeed using the older generation iPhones such as the 5c and 6, so perhaps there is indeed a user base to target.

All things considered, I decided that when it comes to mobile, I should target both android and iOS.

While I am writing about this, I must also mention the state of mobile optimization of the web apps, which are anyway being developed. I would say no. I am not going to go out of my way to optimize the above mentioned web apps to work on the small screen. Folks who want to use the site on their mobile browser should simply install the available mobile apps. Either that or live with poorly optimized web app. That, I am afraid, would be there choice.

Follow me on twitter, facebook and instagram for more updates. Thanks!

Technologies Involved



[Ongoing series of blog posts to inform potential developers, users and (hopefully investors) about this new app ecosystem I am architecting, designing, developing and deploying. More details at this page]

App ecosystem won’t build itself, because developers don’t actually write all the code necessary for the software. A lot of times, it boils down to utilizing libraries that are already developed. If I am building a mobile optimized site, it is simpler and cheaper to simply integrate bootstrap into the code than writing my own mobile optimized stuff.

In this page, the idea is to list out all the technologies, libraries and anything else that we are using. For now, this is all we are using. As more time is spent developing this project, we will update this to list all the stuff we are using.

Windows Desktop App

XAML

C Sharp

Web

Bootstrap

HTML, CSS, JS

jQuery

Android Mobile App

Java

XML

Libraries

Currently none to be mentioned.

[Last Updated February 10th 2017]

Follow me on twitter, facebook and instagram for more updates. Thanks!

Micromax P290 Review



I have had the Micromax P290 for a while now. It is simpler to mention immediately that the tablet is perhaps the cheapest tablet anybody can purchased. It cost slightly less than 3500 rupees (roughly 55 dollars). This wasn’t an impulse purchase for me. As a tech guy myself, I do spend a sufficient amount of studying whatever I buy. It could be a 5-dollar memory card, or a 600 dollar Lumia 1520, I do my homework with diligence.

The idea behind the tablet is simple. You need something that can help you do some light browsing, light app usage (like YouTube, Netflix, Amazon Prime Video), some light photo viewing, email and other ‘light’ stuff. That is what I wanted, and so far, the tablet meets and in some cases exceeds expectations.

Let’s start off with the build quality which is just nice for such a budget device. It’s light weight, probably because of the cheap materials used. The bezel is super thick, so lot of real estate is lost there. The slot for memory card looks very weak and may break even with the slightest hard push. Although the tablet has been dropped from small heights, it has not broken so far. Obviously, there is no gorilla glass and all that nonsense. We are talking basic display with basic plastic/glass something.

The tablet is comfortable to hold. I don’t use a case, but there are a variety of cases available if you are planning to hold it in the hand for long durations. I mostly just let it lie on the ground (a stand is used for this, and must be bought separately. The case will usually include a stand) but on the occasions I use it in the hand, the grip is firm and good. The back has a nice rough exterior which gives solid grip, extremely useful if you are travelling with the tablet in public transport and want to watch or listen to music on the move.

The screen is just okay. The colors are all washed off, the brightness though is too bright. Even at lowest, the display will light up the entire room like a lantern. Touch is alright, although, the low PPI means, you cannot use this draw and stuff. For everyday usage, the screen is good enough. It has extremely low view angles. Unless you are looking directly at it with the proper inclination, everything will look like ghosts on the screen. That is a bad experience but for 55 dollars, I would not expect much else.

Actual usage, is mixed bag. Assuming only a few apps are currently running, the tablet wont ice up. That means, when I open new apps, I should open the app drawer (the tablet only has virtual buttons, of course) and make sure that I kill the apps running in the background. Forgetting to do this means, if the app start consuming too much memory, the tablet will either crash the app, or the entire OS will crash. That leads to the tablet itself restarting. Another issue is when using memory cards. Sometimes the tablet will fail to read cards, at which point, the screen goes blank. You have no choice but to remove the card, and then reinsert it and wait for the length process of ‘checking for errors’ before you can use the SD card files again.

Most apps run fine. Multiple tabs on Firefox (like up to ten, with videos and content) will work just fine. Netflix works fine, although offline videos will occasionally freeze up. YouTube and other apps don’t pose that problem, so may be, it is an issue with Netflix which did not consider playback issues on low end tablets. Browsing on the web is easy, and mostly works okay. However, there will be a slight delay when the keyboard pops up, but that is just how it is. Speaking of keyboards, the tablet’s Bluetooth works beautifully. More importantly, the tablet works beautifully with my Microsoft Wireless (without dongle) Keyboard and Mouse. I usually use the tablet for a lot of writing, for which I use Microsoft Word for Android. It works great and despite it’s low price, the tablet is good enough for writing simple reports, emails and blogs such as the one I am posting right now. Viewing photos and videos is also alright, but compromises in terms of color saturation is important to work with this tablet.

The tablet maker has cut a lot of corner to reach this price point. From that angle, this tablet is excellent device for casual usage, and perhaps for kids and moms and old people to use. I would give it a 5 out of 5, mostly because it delivers what it promises.

Follow me on twitter, facebook and instagram for more updates. Thanks!

They are not making tablet computers anymore




A tablet computer or simply tablets, have been around for a while now. When Apple (10 years ago) introduced the iPhone, it completely changed the landscape of phones. Then, it did it again with the iPad, that completely changed how we could get things done in a new device that was a mix of a desktop computer (larger screen, support for keyboard, increased productivity) but with the convenience of a smart phone (portability, app store, touch screen).

Today, Apple is still the king of tablet making. Obviously, the legion of Android manufacturers go where Apple goes, and have their own range of tablets. All this is good and fun, but things were strangely different when I finally decided to grab one of these bad boys for myself. I found out that many companies simply have stopped making tablets, and there was little choice, if there was any at all. The tablet market has...matured, and has changed drastically.

Oddly enough, the cheapest and decent (at least a 1080 p screen and actually good processor) was from Apple. Can you believe that? Apple making the cheapest product in a given category? Strange world. Despite the low price, buying a tablet (or for that matter, even a phone) is kind of suicidal for a power user or even a casual user. The thing is, Apple steadfastly refuses to allow usage of SD cards. Sure, people in US and Europe and all those modern countries may have super cool broadband access, but here in India, we still have to rely on 'stored on storage' stuff for entertainment. The larger is the storage space on an Apple device, the more insane will the price become. So yes, we dont want to buy Apple stuff. Not yet anyway.

I turned my eyes away from the super attractive apple iPad and looked at the Android offerings. Android has always been the poster child of variations and customizations and give something to everybody. This held true for smartphones (there are phone availabel from as little as 3000 rupees and going all the way up to 70000) and I assumed that they hold true for the android tablets as well. Unfortunately, for me, that wasnt the case at all.

I noticed that there almost all the big name tablet vendors have quit. Taking the 1080 p screen as a minimum benchmark for a decent tablet, there are literally no such tablets being sold at a price that is less than a apple, and has a 1080 p screen. The tablets that are sold fall into two categories. Cheap tablets that cost less than 10000 but have pitiful specifications (like no 1080 p screen) or super expensive ones that cost more than 40000 which are simply not practical to buy.

I looked at myself, and wondered I wanted to buy a tablet. As I have explained in the earlier blog post, I had a niche requirement of a tablet for writing my blog and novels. So, I decided to buy a cheap as salt tablet and now I am blogging on it right now. If not for this writing hobby of mine, I am quite content with my Oppo phone which meets all my other entertainment as well as productivity needs. In other words, the android smartphones have cannibalized their own tablet shaped brothers.

Why would anyone buy (and carry) a 7 inch tablet (the most popular size among tablets) with them when their phone is already 5.5 inches (the more popular screen of phones these days) and can do everything tablets can do. Since people are not buying tablets, there is less innovation in the tablet category. As I said before, the tablet specs are just pitiful. Another reason I could think of is that, tablets dont need to be replaced as often as phones. I have no choice but to buy a new phone every 10 to 12 months because I use it a lot (the mobile nature of my job) and wear them out. A tablet, on the other hand, wont wear out so fast. So, they get replaced less often.

Then, there is the windows 10 factor in play. Tablets are mostly brough for productivity (since phones, and their big screen have gobble up all the entertainment and communication part) and windows 10 is finally making its presence felt. Windows 10 tablets are cheap, they have support for any and all productivity software. Also, they work flawlessly on cheap and expensive hardware, and Microsoft has actually done a good job of selling Windows 10. If not for the fact that some of the apps I need are not available on windows 10, I would have sprung for a cheap windows 10 tablet than the cheap android tablet I am using solely for blogging and writing.

For tablets, they are fighting a two front war. On one side, their own brothers i.e. android phones, are eating into their share. On the other side, Windows (which was desktop only) is now becoming totally mobile (as far as productivity is concerned), is also eating into their marketshare. Essentially, they have become a niche category like health bands and smart watches and other things only some people will need, and every body will never care for them.

Follow me on twitter, facebook and instagram for more updates. Thanks!

There is no ignoring Android, and Google, of course



For a while now, I have become more open to change when it comes to technology. I switched from windows phone to android. No longer have a deep hatred for Google (and its many, many data collection technologies) and related services. Of course, I still refuse to use Google Search but I see that I cannot escape their other services such as maps.

The annual Consumer Electronic Show or CES, is currently under way in the US. CES is where we get a taste of how the world will shape itself in terms of every day stuff. We are talking stuff that people need or perhaps want, depending on where you stand on the economic ladder. I have been keeping up with the barrage of news through my two favorite news sources - engadget and arstechnica - and it is way too much news. This is what geeks like me call a sumptous meal.

As is the trend for the last few years, everyday stuff is becoming smart. Meaning, they are all hooking up to an operating system so that they can talk to the cloud (in the back end) and to an app (in the user end). That is where the topic of this blog comes into picture. The operating system. When Apple released it's smartphone OS, there were two reactions. Some people like Blackberry thought it was joke. Yeah, Blackberry is now pretty much dead. Others like Google woke up. They ran here and there and put together a smartphone OS of their own. Google realized that they are in the 'free stuff' business. Heck, I would say, Google pretty much invented the 'give us your data and we will tell you if you are pregnant' economy.

So, they released Android. The world has not been the same ever since.

Of course, Microsoft did its thing where it acknowledged that it needs to follow the leader. So they tried with windows phone OS. However, poor management of devices and Nokia ensured that Microsoft lost even before it started.

Now, in CES, it is pretty clear that Android is the choice of OS for almost everything. Mobiles and Tablets, they already own it. Then there are laptops running chrome, which are quite alright for essential productivity. Then, android is now powering the televisions (you see how android is slowly but surely conquering the living room, which is where family spend time, and hence, money) and cars are the next logical step. Home appliances will invariably start using android and soon, I guess, everything will run on android.

As a consumer, my concerns are related to the extreme data collection that Google does. Also, you will notice how whenever there is a phone breaking in scenario, you dont really read or hear about how secure Android really is. In fact, Android is open and hence ideal for experimentation. Experimentation also means, there are hundreds of ways to get into stuff. This is pretty much the same scenario with windows on desktops, and hence I wont hold it against android. If something is popular, it is bound to be broken down in so many ways. If you are popular, that is the price you pay for it.

As a developer, I suppose, I will have to get into the android game (I already earn some share of my earnings via android related assignments) a little more deeper than I thought. Popular opinion is that, if you are not in mobile, then you are not going anywhere. More importantly, a myopic attitude (sadly a common feature among tech graduates) is going to be fatal. That means, if anything, I will have to double down on my android skills because that is where the market is heading.

Android will be everywhere, and there is no escaping. If we (developers) dont prepare ourselves for it...things could get pretty ugly, very fast.

Follow me on twitter, facebook and instagram for more updates. Thanks!

android training – Episode 7 – page navigation



Hello and welcome back. May name is Jay, and I am your trainer for today. We are going to assume that you already went through Episode 1 to 6.

We are jumping into development now. That means, the page will be heavy with screenshots. I have tried my best to use low sized images so that you can load this even on a 2G connection. If you are having issues loading any of our tutorial pages, contact us. You will find the contact information, at the end of the blog.

You can download the code for this project, from GitHub, right here – https://github.com/Jay-study-nildana/sn_tr_activity_nagivation_2

If you don’t know about GitHub, check out our blog post here – http://blog.studynildana.com/post/study-nildana-and-github

Topics Covered In This Episode

In this episode, we will look at doing the following.

  • Navigating from one activity to another activity
  • Send data from one activity to another using ‘Bundle’ object

In this app tutorial, we will show you how to go from one app page (or activity) to another app page (or activity). This is a basic level of skill needed in building apps because most apps require you to move between activities/app pages. Further, we will also show you how to send simple data from one activity to another activity using this object called as ‘Bundle’. It is useful for simple data operations.

Of course, if you want to send huge sets of data between activities, a better option would be to use SQLite but that is something we will talk about some day in the future.

As always, here is how your new project should look. If you are not sure how we got something like this, refer our training episodes 1 to 6. I want to draw your attention to the circle. That is where all the layouts (the xml part of an android activity) are located. We are looking at navigating to another activity, so we need to add a new activity.




I just want to add here that an android activity is actually a combination of two pieces.

  • Activity – First Piece – The xml page that forms the UI part and is where we put buttons, TextView and all the visual stuff. This will have an extension of “.xml”. For example, MainActivity.xml
  • Activity – Second Piece – The java page that forms the code part where all the backend action takes place. This will have an extension of “.java”. For example, MainActivity.java

Okay, coming back, there are so many ways to add a second activity. We will do something like this, and follow the pictures in sequence. Start off by “right clicking” the “layout” on the project directory, then selecting “new” and then selecting “activity” and then selecting “blank activity”.





After you do that, you will see something like this. Don’t do anything extra. Leave everything as it is, and hit “Finish”.




Now, you have a new activity called “Main2Activity” which adds two files to your project. One .xml and One .java file, as explained before. Here is the picture to show where they are located.




Now, I am going to do the following.

  • Add some basic text in both the activities. This has already been covered in earlier episodes.
  • Add a button in the first activity. On pressing this button, the app will go from first activity to the second activity. Adding buttons is also covered in earlier episodes.
  • In the button, I will add code that will allow me to go to second activity. This I will explain in detail.

So, here is my OnClick function for the button. This is how it looks before I add the code that will perform page navigation.

            @Override
            public void onClick(View view)
            {
                //This is where I will write my code that will move the app from this activity to the next one

            }//end of OnClick function

In order to perform page navigation, I need to use Intents. Someday, I will write a detailed blog post about Intents. For now, understand that Intents (short for Intentions) are something that will use whenever you wish the app to do something for you. Right now we “Intent” to navigate to the second activity.

So, I will fist create an Intent, and assign it a purpose. Check out the code snippet, and the code comments to understand what is happening. This is how it will look after I have added the code that will perform page navigation.

            @Override
            public void onClick(View view)
            {
                //This is where I will write my code that will move the app from this activity to the next one
                //I now create a intent object, and then provide it with the application context and the class
                //of the activity i want to go to
                Intent in = new Intent(getApplicationContext(),Main2Activity.class);

                //after assigning the intent, I will then start it.
                startActivity(in);

            }//end of OnClick function

Now, let me run the app, and see if the page navigation is actually happening. Here is how app looks upon launching.




And it has come to the second page/activity, after pressing the button




Alright then! Our app is doing simple page navigation. Basic navigation is of no use, if we cannot send some data. Next, we will send a simple sentence (string) from the first page/activity to the second page/activity. To do so, as informed before, I will use a Bundle. You see, a bundle uses a simple database that is based on the key/value principle of storing data.

Perhaps someday, we will write a detailed blog post about key/values. Till then, the basic concept is that when storing data, we will first create a ‘key’ and then assign some value to it. Later, we use the ‘key’ and then extract that value from the Bundle.

Here is the code that will use the Bundle, a key and its value. Follow the comments to understand what is happening. In this code, I am sending the words “page navigation tutorial from study nildana” from the first activity to the second activity. Please note that this code is in the “MainActivity.java” file.

                //I now create a intent object, and then provide it with the application context and the class
                //of the activity i want to go to
                Intent in = new Intent(getApplicationContext(),Main2Activity.class);
                //after assigning the intent, I will then start it.

                //I wish to send a string that contains the sentence "page navigation tutorial from study nildana"
                //so created a string variable that will hold this sentence
                String sentence_to_send = "page navigation tutorial from study nildana";

                //Now, putting this String variable into the bundle that will go with the intent
                //Remember the key and value thing we talked about in the blog?
                //Here the key is on the left side and the  name is 'sentence_from_first_activity'
                //The corresonding value is the variable 'sentence_to_send'
                in.putExtra("sentence_from_first_activity",sentence_to_send);

                //now, when this intent is started, the bundle we sent will go to the next page.
                startActivity(in);

Now, I need to move to the second activity, and collect this bundle. Then, I need to collect the string/sentence I want, using the key I used in the first activity. Check out the code snippet and the comments to understand what is happening. Please note that this code is in the “Main2Activity.java” file, which is the target of this intent.

    @Override
    protected void onCreate(Bundle savedInstanceState)
    {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main2);

        //first I need to create a bundle object to collect all the extras
        //here i have creaed a bundle and also collected all the sent values
        Bundle b = getIntent().getExtras();
        //now I will use the key that was used in the first activity to collect my string value
        //the collected string value has been stored in the variable called 'temp'
        String temp = (String) b.getCharSequence("sentence_from_first_activity");

        //now I will set the text of the TextView object that is already in this activity

        TextView textView = (TextView) findViewById(R.id.textView_second_activity);
        textView.setText(temp);
    }

Now, let me see if the app actually sends the string by running the app.




And, look at that. The information did come through the bundle.




Well, there you go. We now have a simple app that will navigate from one page to another. It will also carry some data with it. As always, don’t forget to download the code from our GitHub repository right here - https://github.com/Jay-study-nildana/sn_tr_activity_nagivation_2

Next episode, we are going to show a simple calculator that will use all the concepts that we taught you from Episode 1 to Episode 7. In fact, one of study nildana students will be building that app. 

Follow me on twitter, facebook and instagram for more updates. Thanks!

android training - TextView



This is a bit tutorial to give you some insights about the Android widget – TextView – and stuff that about it that just might be useful to you.

  • TextView is perhaps the most basic of widgets that you will be using when building your apps. You will use it primarily to display information. Here are some scenarios where you might use TextView
  • You want to display a message, asking the user to do something.
  • For instance, in the ‘alert nildna’ app, we are using TextView to display messages like ‘enter the random key’ and also to display the downloaded GPS data.
  • You want to update information after it has been collected from the user.

The Android Studio already provides a number of different types of TextView widgets. Look at this image here. You see, all those four options are all ‘TextView’ widgets but with different options.




You will get the properties option, when you select the TextView widget like this. On the left side is the TextView display some basic information and on the right is the properties of this widget.




Further, you may want to consider doing some additions to the properties.

  • Id – use this to set the id of your widget.
  • Text – use this to set the text.
  • Width – you can adjust the width of this property, height as well as width.
Follow me on twitter, facebook and instagram for more updates. Thanks!

android training - Reasons to Deploy to Device



This is a bit tutorial to give you some insights about deploying to device. There are a number of reasons why you should always consider deploying your app to your device, at least once, if not all the time.

Here are some of them.

  • Although the requirements for android studio are on the lower side (find installation instructions right here - ), the android emulator requirements are on the higher side. In other words, it is possible that the emulator may never run on your PC.
  • Even if you somehow manage to get the emulator to run, you will notice that it is something of a resource hog! As it is Android Studio is perhaps the most inefficient IDE out there. It already slowed down your PC like crazy. Add the emulator to the mix, you have a really slow computer that makes the entire process of development a frustrating and painful experience. For instance, most of us are still using PCS or Laptops with 4GB and by god that is in no way, sufficient for Android Studio or the emulator. Use deploy to device to make the development process slightly faster and less frustrating.
  • There is a lot of difference between getting the app to run on your emulator and run it on the device. Many a times, the app runs just fine on the emulator but crashes the moment you deploy it to the device. There may be some additional debugging you need to do, and that is only possible when you deploy to the device.

Follow me on twitter, facebook and instagram for more updates. Thanks!