react-native-maps with google

For one of projects that I’m working on these days had to use a map view to cover of up the requirements. I found out that react-native-maps is good plugin recommended everywhere which is initially started by airbnb.

With the various issues and changing requirements I had to go from tile based map to a google map. It’s really nice that this plugin could handle both types.

React-native at the moment does not support leaflet based mapping since lefalet directly manipulates dom which is not supported by react-native from the basics. react-leaflet does not supported to react-native.

Installing react-native-maps with google was quite troublesome where took a half day of me to figure it out properly.

Here are stuff I did from the start to setup google maps, because installation guide didn’t work for out of the box

  1. react-native init {projectname} in command line (“0.42.0”)
  2. cd {projectname}
  3. npm install react-native-maps –save which will install react-native maps ( “^0.13.0”)
  4. Do not run any linking commands
  5. next step would be to react pod file with pod init
  6. copy the linked content to pod file, change the {projectname} as mentioned, run pod install
  7. yoga error then add the below line to pod filepod “Yoga”, :path => “#{react_native_path}/ReactCommon/yoga”
  8. Close xcode, and open {projectname}.xcworkspace file in xcode
  9. drag AirMaps and AirGoogleMaps to root of your project, and select create groups radio, don’t check copy items if needed
  10. Create a google api key with iOS bundle id added to the key , this sync up take few minutes (wrong key will show you a google singed empty map) once you run
  11. #import <GoogleMaps/GoogleMaps.h> and    [GMSServices provideAPIKey:@”{your_key}”]; lines to AppDelegate.m file top then inside didFinishLaunchingWithOptions respectively
  12. Add below map view code, with out absolute positioning it will be white blank screen, with out key if you use google it will be goole logo with empty screen

Enjoy… react-native-maps google.

after big bang

He woke up with  the first light beam coming through his eyelids but really did not had an any sort of feel towards that. Just felt numbness, emptiness and burning white flash in front of his eyes. If he could remember that moment even now, or at least he could imagine what was that moment like it would give him the same giggle that he went through in the exact moment.

Huge flashing white light burned in front of his eyes, made him choke for a moment. Again he choke, he felt like something is not right, he tried get ease by clearing the throat, effortlessly crying helped him to be happy and get the choke away.

Felt that dry cold wind blowing around and flowing inside towards stomach, but didn’t had any control over any of these. Just what he could do was crying. No memories, no thoughts nothing. Just crying made things easy for him. He felt lips have touched something, instinct made him to suck it. Didn’t know how he manage to get that out of his empty head but just went with the flow. First few times he did not felt anything. Then something wet and warm liquid was going through his whole body. That feeling electrified every nerve in his body. It was too much think about and to understand, only thing he could not do is stopping it.

That liquid  was so unforgettable and  made him live just looking for that magic liquid. When he could not find it at his lips he tried make who ever have it notice just by crying only language that he could remember. More he cried he was given more liquid still the whole life is just white or black.

Still after some time it was cloudy or hazy in front of his eyes. He saw one figure more frequently. He liked the warmness an specially the liquid that he could never forget. He didn’t know by the time this figure is the person he’s going to call “Mother” rest of his life.

dealing the unknown mammoth

In competitive corporate environment it’s obvious at some point we all get some project or an assignment which is completely based on a subject or theory which is completely unknown and also sound quite big and exciting in same time. Manager or the client who describes about it knows little about it how it works inside but he wants it get it done with short time with working product with number of features? If you haven’t it will not take too long to reach some point like this in your career.

In the context of technological fields this is much common scenario people find so exciting to have the products which are benefited from the emerging technologies. As result of this employee’s days come harder and harder to meet the requirements of the projects with failing and risking their carriers. The most devastating fact is about these kind of projects the abstract explanation about the project is not broder enough to give in depth idea to about the scope and feature should have inside. Also rather this ideas sounds so exciting and interesting while pitching the value delivery of the product does have incompatibilities with business requirements as well. Most of projects fails in this backgrounds as well as end up adding more resources or time wastage to existing process.

Special most of startup ideas are like this few work out well most does not, but as person who got a project assigned to like this and there is no options rather than build it from the scratch following ideas may help you how to get through difficult days to come in the project.

First days of kicking off the project

Since things are unclear and sounds so big procrastination and the fear of failing with emerges within the few hours to you. This is so obvious that since the background of project that sound so unknown to you before, but that you have to master the subject in order come up with a successful product. This is so general set of feelings that one have to deal with therefore it’s good always to believe things will work out well and start with something small. Take baby steps.

Most of people endup with doing many rounds of research for first few weeks without having any valued output. So best way to deal with unknown projects is try to build up some understanding of the product and look thoroughly is there any divisible parts that you can identified. Once you get a pick on these small components works with in the project break it into much smaller components which you feels happy and easy to deal with. But always try to attach some value delivery to each of these components. Develop plan and shipping of each component, rather you don’t know how much time it will take just go with with your gut feeling it can be justified later. Having a timeline is much important than having lot of knowledge about a product. This will make you understand depth this project can go for. Research with this knowledge can make your researches much productive.

Think we are making a shooting robot which can fly. Idea is at least you know you have to have gun and flying machine. This is good start. Start developing a gun which can shoot with a less backfire which can help to stabilize the flying machine. Assuming gun can be made within a month and flying machine will take two months to build. Another three months for integration and testing. Research about guns how it can be made make something similar. Research on flying machines in depth can be push later when it matters in the timeline. Doing something what matters and getting into the project is most important at early stage project rather whole effort become throw away it matters you start doing something rather than thinking of endless possibilities.

Second stage

With the excitement and the motivation that you have in the start, slow start decaying with the time and get a stage where you have to pull things from external motivation. It’s normal this kind of a mind set will sneak in to you with the progression of the project if things are proving to be progress slowly. Build up routines is much important at this stage. Soon as you start doing something and the first time you have something get working make it a habit that you can repeat yourself and improve your approach with each component you build.

For this alway try to make your mammoth projects goal into small pieces which are more achievable and simple. Break things into small pieces which carries a some kind of value with the small job that you try to finish. The problem we encounter divide and conquer approach is people tend break things in the perspective of effort. What work out best in this context is to go with the value and break it down. In way at end of each point you achieve something small you have something to show up to your manager or client. Which is is good fact to showing the progress and always allowing to have changes what necessary. Buy doing this the best practical part is that the amount knowledge your client or manager is develop about the project and you can see exactly what client need very early stages of the each component or small value delivery point. This learning curve matters to both the parties.

Importance of keeping Client or Manager engaged

With the time rather you make positive or average progress, you have to keep things transparent about the approaches you are trying to make and how that will add value to the end product. This will save your job in long run rather whole output is not convincing. There’s a matter of fact the path lead final product is well known by the both parties. So the frustration that adds up knowing product is heading towards dead end before hand is much effective coming up with a failed product after 200 days of hard work.

This may be even can be defined as a useless time wasting sessions or meetings by the other party try to make this meeting fruitful as possible before hand preparing to the meeting and making the session really important too.

Progress sharing

Visibility of effort you put into project is much important in this context make things justifiable to both the parties. Kanbanflow or Trello like tools can be real handy simple sharing managers that can help you keep let your client or manager see how you deal with the Unknown Mammoth and exactly is your effort is pointing towards the abstract idea that saw within inside them.

There are many things about your approach and the project progression  cannot be  explained via verbal discussions in meetings but where  micro blogging or small diagrams with these sharing tool can explain much effectively to other party engaged in the project. Using some knowledge mechanism tool with hand in hand proven to be much effective.

Handling expectations & new requirements

For a moment if things goes well may be client or manager will make up picture that this is the time to bring improvements. This is happen mostly soon as you build positive progress towards end product.

To be honest most of projects start going haywire with this kind of nonstop requirements that comes in the middle stages. Try to keep the requirement logs of the project frozen if isn’t the the idea is really really important. Other than make them in the next version. It’s ok go with a minimal set of features for initial version of project with the time things can be develop.

Give the manager or the client the understanding the that a product you build is a one hit stop it can take improvements and this is the time that you trying get thing up and running and you are not with idea of adding new requirement. Since rather adding new things keep manager or client happy will not work for both the parties in long run. Best way is to stand in you view in formal way and with facts in hand and in same time handling the expectations of the other party.

Quality Assurance

With these kind of projects very few percentage that reach a coast successfully projects are not proven to be products that can be sell at the very beginning. Lack of understanding of this aspect make people think they can go out there to real world and sell the product soon as they shipped. Making client known of this possible landmine can help you to retain your client or manager and also keep things moving forward.

From the very early stages of the project’s quality should be maintained where deliverable components should be quality checked at very early stages. Only because quality maintenance process have make bigger companies have make successful products back to back. This is important point where most lack of knowledge when it comes to internal organizational softwares development as well. Quality is aspect any product development life cycle should plan with care.

Making things into rigid flow

Rather things start small within your control of you with this project when they become success with your sleepless nights of hard work it will grow only have proper flow of scaling. So once you see other corner of light of the dark tunnel try make things much process oriented cycles which can repeat again and again with less effort. This process with help to streamline the shipping of good product you come with.

Proper flow of work process make thing more manageable.

Last words

Working with projects with unknow contexts is quite good skill to develop specially in technological fields. Above are few tips will help for someone starting to work with unfamiliar bigger project. It’s better to understand that this is a risky process to involved in end up in success or failure depending on many facts including your commitment. There’s no replacement for commitment. Still having a overview how things can end up is quite help full every stage of the project.

Please share your ideas how things work well for you dealing with these big black boxes.  

event loop in javascript context

Event loop is much important concept to be understand exactly to get best out of Javascript. Without knowing event loop programmers can work on javascript but when it comes to higher degree of interactivity and smooth client interaction as your application grows event loop is a concept that Javascript developers have to master. There are many posts we can get the understanding of event loop. In beginning there are few prerequisite concepts that one have to grab before hand to understand end to end workflow of event loop.

Bit of history

Before coming directly to Javascript event loop and how it work it’s better if we consider the history of event loop at it’s early days since it make things much more clearer. Event loop is programming construct that systems implemented technique used message passing.

Event loop is the program construct wait event to occur and dispatch the occurred event with designated event handler of the particular event.

Going further into history this pattern was in need when things advanced to GUI based applications from one time executed command line based programs and form menu driven programming. Above two application types are less interactive to the users. But with the much interactive applications programs needed handle multiple processes for I/O bound operations as well as system related. Single event handler waiting to free resources were not supporting this kind of a interactivity. Usage of the event loop program construct allowed programs to wait until events to occur and add it to a pool letting those events to be handle by a another program, at same time giving user to go forward with the interacted workflow with out blocking most of the time. To further master OS level event loops there are more relevant posts can be found.
With having some idea about event we’ll move forward what really event to loop have to do with javascript. Javascript has two main context front-end based implementations and server side implementations.

Since most of us take the advantage of browser level Javascript, here as an example Chrome browser Javascript rendering can be much practical. The knowledge gain by that can lead us to understand even how nodejs works in server side too.

Rather Javascript is single threaded language, how really browser handle concurrent user interactions with a application? Behind the scene Javascript runtime only can do one thing at a time. But there are several component help Chrome to execute Javascript concurrent manner in the browser.
Event-loop
V8
In Chrome V8 is the Javascript rendering engine with directly compiles Javascript in to machine language instead of intermediate bite code. This increased browser performance in way Chrome with V8 engine won the browser war with firefox, safari & IE  with a par lead user base.

Call stack
Call stack is the place where browser keep the listing of records where is the current execution happens in the program,  which is recorded in a stacked data structure. So a simple console.log(“Hello world..!”); Directly pushed on to the Call Stack an immediately get executed and pop from the top of the stack. Simple but a effective way of handling the execution of a list of function. Once function is identified it get pushed to the top of the call stack, then once it’s executed it’s  removed or pop from the top of the stack.

Web APIs
Web API supports browser to additional features, like DOM, Ajax, Set time out. These API component can not be controlled or access or overwrite but which can be call using javascript API calls.

Callback/task queue
Callback queue is a list of tasks coming through Web API which are waiting to be pushed into the Call stack to get immediately executed. But this keep wait until Call stack is empty.

Event loop
With above components where event loop can fit inside the browser. When describing the Callback queue there’s a need interlink in between Call stack and Call back queue. Where a component can check weather Call stack is empty and push the Call back queue tasks in to Call stack if stack is empty. So this is repeating process where  this check and push process take place. Design methodology of event loop fits well to serve this need when executing Javascript in the browser.
Exact thing event loop does is constantly looking for Call stack to get empty and if it’s empty push new tasks into the Call stack from the Call back queue.

Why we want to know Event loop?
Getting to know how event loop exactly work helps developer get the applications responsive in higher degree of user interaction and also avoiding unexpected behaviour of application front end. Rather we don’t have controller over event loop proper basics can lead a developer toward better code where execution meets the expectations. Where reduces frozen GUI or lagging GUI as well as unexpected order of execution.

Server side context
Pretty much the same way that we can explain nodejs related event loop also works pretty much the same way difference is instead of Web API nodejs access C++ API. Event loop does the same fetch tasks from the queue and dispatch the event with the handler.

Code works

#1 sample

(function (){
console.log(‘Hello World..!’);
})();

Explanation :-

  • task directly recorded to call stack and get executed

#2 sample

(function(){
setTimeout(function(){ console.log("Delayed Hello"); }, 3000);
})();

Explanation :-

  • task record to call stack
  • call stack execution calls setTimeout in browser API
  • wait for 3 seconds since timeout is 3000
  • add task to call back queue
  • if call stack empty event loop push task to call stack

#3 sample

(function(){
console.log(‘Hello ’);
setTimeout(function(){ console.log("Just after Hello"); }, 0);
console.log(‘World..!’);
})();

Explanation:-

  • console.log(‘Hello ’) push to the call stack
  • log “Hello” to the console
  • setTimeout push to call stack
  • Call setTimeout browser API
  • Add task to task queue
  • same time console.log(‘World..!’) push to the call stack, because of this above console.log(“Just after Hello”) can’t enter call stack because it’s not empty
  • Execute console.log(‘World..!’) in Call stack
  • Now Call stack is empty can execute console.log(“Just after Hello”)

Important
Javascript execution asynchronously keep pushing event to the call stack, there for at the time setTimeout called console.log(‘World..!’) get push into the Call stack, therefore it execute immediately, then event loop get the chance to put a event push in the Call stack since it’s empty.
Another important point is to know setTimeout not clearly defines this the time of execution possible minimum delay is only guaranteed.

rich interactive media towards better education

Education like every other field is evolving in rapid phase with introduction of mobile internet technology. It gives the ability content to be delivered with quality and with more information in a much expressive way to the learners all round the world in matter of seconds. With the quality of infrastructure is rather always discussed still there can be great improvements to be done towards the quality and value addition to the content.
The context of educational medias have come a long journey starting from verbal reciting up to virtual reality spaces of education. This evolvement have given leaners much depth in the there knowledge and to seek much intellectual outcomes than ever. Really what are the gaps that still world can establish a rich media based education network which and enlighten the next generation in to better way of knowledge delivery cycle.
Our world can for see a future only with a knowledge delivery network.
Having this in mind what are the new alternatives and additions have come to challenging traditional patterns of eduction system and how effective all currently? There are few facts to consider here, People more than ever exposed to the information and much more in to irregular eductions sources where with the internet lot of open knowledge networks are well established. Wikipiedia is good example for informal knowledge delivery media helps and opened up people huge amount of knowledge widely open and also really helps if a person is self learning something as a beginner. Still really such widely known systems struggle to go forward and aiding world’s knowledge delivery cycle. It have to reach it own barriers with the time with infrastructures.
Still it’s really hard to get away from the text based knowledge storing platforms came up from way back. Since rich media adds complexities in referencing it always text based knowledge expressing has become the most commonly used standard. Overcome this will take time, but what are good alternations out there have modern approach to overcome traditional knowledge delivery barriers?
Multimedia specially audio and video based educational medias can be really handy achieving higher level of understanding of complex theories rather than using a sketch printed in a paper.The quality of the learning process can be more enhanced if the interactive media replaced this old sketches.
People have to get across digital divide which will open this possibilities to the world. Yet there are plenty of places which they can reach all set of technology and infustructure and still not using those to enhance the process of education.
This can be described as making enhance through put of education, this will make the current process more effective. The understanding made by rich media education with make learners to go further in to exploring new ways of doing things with understanding they got with aid of rich medias. It will have a great impact toward progression of education and progression of world. The day this become a reality and attached in to formal eduction main stream is just around the corner. People will teach themselves almost anything to do miracle stuff with less time and with much awareness that can make things in to a much brighter future.

enjoy inner serenity

Now and on in life there are good and bad days in life. It’s really defines the way the eyes of society pick things. For life every situation can build a bit of traction of anybody’s thoughts let a person to identify himself inside. To be real sometimes this traction of thoughts overrides the peaceful inner voice of self and make things look so desperate. Still I think there are better ways of handling these sort situations and emotions in a better way where a person can get own advantage towards life’s growth.

It’s so real what we think as an individual and also quite true representation of the “Self” if we give it a consideration. Selfness is so real then, but can it be a directly see as we look in to it as group of people? So why it can’t be a illusion to have a selfness? We can look in to selfness in different angle. As humans we individually go through a much similar thought process to give definition to the “self” that each of us are believing in. Evaluating on the stuff we come across in day to day lives our imagination concludes each time that what ever happens is positive and negative to ourselves. Does this groups sounds supporting for us in long run?

So how can we make things happen to us in to simply two groups as good and bad mostly depending on others perspective knowing that each thing happens to us is quite personal and unique? So things what society see in outside may be not the real story inside. So from that I conclude that anyone can have their own definition or justification of doing things where they can estimate that a certain choice is the most correct choice to make at that particular moment.

What I’m concluding towards is for in life events there can’t be things occurring that can grouped in good and bad, everything what happens to ourselves is quite unique where that makes it out of equation to put in good or bad by looking at outward perspective. Good life events are ok to go with feel the happiness it so natural to make our own.

It’s about how we manipulates the situation to our advantage rather than sinking in a conclusion that gave us by the common opinion of the society.

To get this further I trying write up my own life example back in 2007. I have become Software Engineer accidentally to be through. Yes Accidentally, because in my country Sri Lanka where we entertain free education and our thinking patterns growing in a way we have go to best university that we selected sorted according to the payroll and social respect that each degree have. Mostly not by the individual interest of doing things. I had the same scenario where at that time where we are more  influenced by the Civil Engineers in my mathematics stream. I did not had the enough score to  get in to the Civil Engineer for a free campus really even I didn’t had much passion of it too. It’s the social opinion concluded a boy to be. I liked it be at Moratuwa University which is the best engineering university, much seems to be impossible by the time I’m doing the exams.

So I did the exams and selected to Moratuwa University second time according my thoughts and also random course which I didn’t  had control of depending on my results, that course delivers bachelors degree in Information Technology. So I registered there in the information technology degree without knowing much about computing rather than playing some sort of a simple game or playing movie in a computer. But I did know how to assemble with out ever touching a manual in my whole life just by looking at it. It not thing to be proud of but I liked doing it.

After 3 months I have a another letter from University Grant Commission saying that I can register in the degree Quantity Survey in same university which took my family’s attention and they suggested me to register for that. I went there and registered for the new degree and also went on for the classes for two days where one of the administrator lecturer called me to her office and said you have to register again in next year since they have done there academics for three months and start as fresh graduate in next year. This is really a tensed and emotional moment to me, since I have to wait for one year more to get registered to the course of Quantity Survey. I exactly pointed out the reason to the lady lecturer about the situation, the reason for being this matter is due to Quantity Survey Department cancelling there orientation program of first 3 months which is common practice of every faculty, aiming to be much effective with there timelines which make students like me to  be victim of a conflict in between two timelines and protocols. She had nothing to say and directly gave a meeting with dean saying “We can’t handle your talks, go and meet the Dean of faculty tomorrow..”.

I’m had great disappointment about that they want to settle me in to next year batch which is not there physically by the time. I disappointed and did not had any clue what to choose. In while I really had the best thought of my life, I told myself “I should not play there game, I should get back to where I came from….I should go back to IT”, and I changed every “should” to “must” in above sentence next fraction of the second and didn’t let any other thought distract my new idea. Then just went on with it which gave me a huge release. I felt the happiness getting back really what I wanted to go with again with in myself. Only that moment I got know I’m so attached to previous degree I left one day ago.

I didn’t wanted that Quantity Survey Degree that degree anyway I started liking Information Technology for that last three months, so in front of dean in the meeting next day I just asked to reverse my course and transfer me for the previous course. Funny within three days I change my knowledge stream of life to Information Technology  to Quantity Survey  then back to Information Technology.

In that short period of time I was under pressure not knowing the exact answer, I trusted my inner voice it’s computer that I’m going earn my life happiness not the number of bricks and cubes of sands. It worked for me more than I thought, looking back from now 2015. It grew from the scratch of a thought from that day till today which gave me huge amount of positive thoughts kept me at as respectable person in front of myself. By that time the gravity of that situation is so low but now feels so respect and happy making that choice.

We have to make choices in life. Life is all about making micro to mass choices.

Micro choices we make even have huge impact in life when it comes to long run.

Everyday we have to make choices can be viewed as good and bad for eyes of society. It become real hard to make choices with the traction of emotions and the gravity of the situation. Before make a one those any choices try listen to your self for fraction of second and try to be a part of that new idea applying your self in to it. It will fail you here and there, but still if you can hold on to the moment that occurring of that  idea with the trust and passion in long term that micro moment of pure happiness is going to serve you in masses of happy thoughts. With computer and IT enjoy the same feeling again and again protecting that pure happiness occurred at that day, where I had to make decision at a quick time that’s going to change my whole life. I hated that lady lecturer who made me down that day, but now I’m really grateful to her coming with that idea to send me to next year batch and giving me that precious moment to hear my inner serenity.

That’s where I found that thought of go with IT, and hold tightly it even now with mush passion and love in my mind. It make me so blissful every time when I sit in front of computer. Each and everyday happening something good or bad just way the outward look of a thing. But how a person manipulate that within his mind and assessing it in to a life changing trigger to a new thinking process is a talent we should practise everyday.

With the proper practise is there with in you nothing good or bad will happen to you it’s only a situation where you have to hear your inner serenity and enjoy it.