I received a notification from Firebase and it's working good, but I need to show a dialog fragment when click into the notification.

 public void onMessageReceived(RemoteMessage remoteMessage) {

    super.onMessageReceived(remoteMessage);

    switch(remoteMessage.getNotification().getBody()) {
        case "A":
            Uri sound1 = Uri.parse("android.resource://" + getPackageName() + "/" + R.raw.simple_message);

            Uri defaultSoundUri = RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION);
            NotificationCompat.Builder notificationBuilder = new NotificationCompat.Builder(this)
                    .setSmallIcon(R.mipmap.ic_launcher)
                    .setContentTitle("Notification Title")
                    .setContentText(remoteMessage.getNotification().getBody())
                    .setAutoCancel(true)
                    .setSound(sound1);


            NotificationManager notificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
            notificationManager.notify(0, notificationBuilder.build());
            break;


        default:
            Uri sound = Uri.parse("android.resource://" + getPackageName() + "/" + R.raw.simple_old_ring);

            Uri defaultSoundUri1 = RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION);
            NotificationCompat.Builder notificationBuilder1 = new NotificationCompat.Builder(this)
                    .setSmallIcon(R.mipmap.ic_launcher)
                    .setContentTitle("Notification Title")
                    .setContentText(remoteMessage.getNotification().getBody())
                    .setAutoCancel(true)
                    .setSound(sound);


            NotificationManager notificationManager1 = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
            notificationManager1.notify(0, notificationBuilder1.build());
    }

}

When click into the notification I have to start this fragment dialog:

public class TestDialog extends android.support.v4.app.DialogFragment  {


public TestDialog() {
}

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    View rootView = inflater.inflate(R.layout.dialog_test, container, false);

    return rootView;
}

public Dialog onCreateDialog(Bundle savedInstanceState) {
    Dialog dialog = new Dialog(getActivity(), getTheme());
    final View view = getActivity().getLayoutInflater().inflate(R.layout.dialog_test, null);
    dialog.setCanceledOnTouchOutside(false);
    return dialog;

}

public void onActivityCreated(@Nullable Bundle savedInstanceState) {
    super.onActivityCreated(savedInstanceState);
    getDialog().setTitle("Uer Settings");
}
}

Any idea??

Most popular MVVM-frameworks allow some kind of loops for list type properties. For example Knockout has the foreach-binding. It allows you to loop through the elements of the list property and for each element the markup contained in the foreach-loop is duplicated. Inside the copy, the current element is used as the context for data-binding.

I was looking for something similar in Android, but I only saw the possibility to bind a list to a specific ui-element. But this is bad with respect to declarativeness because I need to create a UI element in code.

Is there a way to simulate something similar using the data binding features from Android? If not, is there a workaround? Or a way to extend the binding syntax?

I am making an app using this tutorial. I made some changes in my code, ie I wanted to get data from server to my main activity and pass it to my fragments. Before that , when I would open the app it worked perfectly, bu now it crashes. I have tried a bunch of answers from stackoverflow (1, 2, 3, 4, 5...) before asking a question, but none of them answered my question. When I was getting restaurants from fragment directly it worked perfectly but passing the data from the activity causes this error.

Main Activity (I pass get data from server and pass it to fragment):

TabLayout tabLayout = (TabLayout) findViewById(R.id.sliding_tabs);
tabLayout.addTab(tabLayout.newTab().setText(getString(R.string.tab_map)));
tabLayout.addTab(tabLayout.newTab().setText(getString(R.string.tab_list)));
tabLayout.addTab(tabLayout.newTab().setText(getString(R.string.tab_my_list)));
tabLayout.setTabGravity(TabLayout.GRAVITY_FILL);
tabLayout.setTabMode(TabLayout.MODE_FIXED);

final ViewPager viewPager = (ViewPager) findViewById(R.id.viewpager);
final PagerAdapter adapter = new PagerAdapter
    (getSupportFragmentManager(), tabLayout.getTabCount());
viewPager.setAdapter(adapter);
viewPager.addOnPageChangeListener(new TabLayout.TabLayoutOnPageChangeListener(tabLayout));

RestaurantsFragment restaurantsFragment = new RestaurantsFragment();
Bundle args = new Bundle();
args.putParcelableArrayList("restaurantList", (ArrayList<? extends Parcelable>) restaurantList);
restaurantsFragment.setArguments(args);

FragmentTransaction fragmentTransaction = getSupportFragmentManager().beginTransaction();
fragmentTransaction.replace(R.id.sliding_tabs, restaurantsFragment);
fragmentTransaction.addToBackStack(null);
fragmentTransaction.commit();

Restaurant Fragment (I do get data from my main activity, I get the restaurants from the server when I debug):

public class RestaurantsFragment extends Fragment {

private static final String TAG = RestaurantsFragment.class.getSimpleName();

// Restaurants json url
private ProgressDialog pDialog;
private ArrayList restaurantList = new ArrayList<>();
private ListView listView;
private CustomListAdapter adapter;

@Override
public View onCreateView(LayoutInflater inflater,
                         ViewGroup container,
                         Bundle savedInstanceState) {
    View view = inflater.inflate(R.layout.fragment_restaurants, container, false);

    Bundle bundle = this.getArguments();
    if (bundle != null) {
        restaurantList = bundle.getParcelableArrayList ("restaurantList");
    }

    listView = (ListView) view.findViewById(R.id.restaurants_list);
    adapter = new CustomListAdapter(getActivity(), restaurantList);
    listView.setAdapter(adapter);

    pDialog = new ProgressDialog(getActivity());

    pDialog.setMessage("Loading...");
    pDialog.show();


    return view;
}

fragment_restaurants

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".sliderfragments.RestaurantsFragment">

<ListView
    android:id="@+id/restaurants_list"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:divider="@color/list_divider"
    android:dividerHeight="1dp"
    android:listSelector="@drawable/list_row_selector" />

</RelativeLayout>

list_row

<!-- Thumbnail Image -->
<com.android.volley.toolbox.NetworkImageView
    android:id="@+id/thumbnail"
    android:background="@drawable/default_profile"
    android:layout_width="80dp"
    android:layout_height="80dp"
    android:layout_alignParentLeft="true"
    android:layout_marginRight="8dp" />

<!-- User Name -->
<TextView
    android:id="@+id/userName"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_alignTop="@+id/thumbnail"
    android:layout_toRightOf="@+id/thumbnail"
    android:textSize="@dimen/userName"
    android:textStyle="bold" />

<!-- Date -->
<TextView
    android:id="@+id/date"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:layout_below="@id/userName"
    android:layout_marginTop="1dip"
    android:layout_toRightOf="@+id/thumbnail"
    android:textSize="@dimen/date" />

<!-- Time -->
<TextView
    android:id="@+id/time"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:layout_below="@id/date"
    android:layout_marginTop="5dp"
    android:layout_toRightOf="@+id/thumbnail"
    android:textColor="@color/time"
    android:textSize="@dimen/time" />

</RelativeLayout>

Stack trace:

10-09 12:30:12.755 32374-32374/? E/AndroidRuntime: FATAL EXCEPTION: main
  Process: com.test.kemo.restaurant, PID: 32374
  java.lang.RuntimeException: Unable to start activity ComponentInfo{com.test.kemo.restaurant/com.test.kemo.restaurant.MainActivity}: java.lang.IllegalStateException: HorizontalScrollView can host only one direct child
  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2195)
  at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2245)
  at android.app.ActivityThread.access$800(ActivityThread.java:135)
  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1196)
  at android.os.Handler.dispatchMessage(Handler.java:102)
  at android.os.Looper.loop(Looper.java:136)
  at android.app.ActivityThread.main(ActivityThread.java:5021)
  at java.lang.reflect.Method.invokeNative(Native Method)
  at java.lang.reflect.Method.invoke(Method.java:515)
  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:827)
  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:643)
  at dalvik.system.NativeStart.main(Native Method)
  Caused by: java.lang.IllegalStateException: HorizontalScrollView can host only one direct child
  at android.widget.HorizontalScrollView.addView(HorizontalScrollView.java:216)
  at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1083)
  at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1248)
  at android.support.v4.app.BackStackRecord.run(BackStackRecord.java:738)
  at android.support.v4.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:1613)
  at android.support.v4.app.FragmentController.execPendingActions(FragmentController.java:330)
  at android.support.v4.app.FragmentActivity.onStart(FragmentActivity.java:547)
  at android.app.Instrumentation.callActivityOnStart(Instrumentation.java:1174)
  at android.app.Activity.performStart(Activity.java:5347)
  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2168)
  at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2245) 
  at android.app.ActivityThread.access$800(ActivityThread.java:135) 
  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1196) 
  at android.os.Handler.dispatchMessage(Handler.java:102) 
  at android.os.Looper.loop(Looper.java:136) 
  at android.app.ActivityThread.main(ActivityThread.java:5021) 
  at java.lang.reflect.Method.invokeNative(Native Method) 
  at java.lang.reflect.Method.invoke(Method.java:515) 
  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:827) 
  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:643) 
  at dalvik.system.NativeStart.main(Native Method) 

I know this has been asked before as well, but I have done all I can so help. I have updated all I can from SDK manager but still I am getting this issue with my project that I just created. There is no functionality I have given yet, but the issue is it says plugin too old, please update or to change the ANDROID_DAILY_ENVIRONMENT variable.

This is my gradle file

apply plugin: 'com.android.application'

android {
compileSdkVersion 24
buildToolsVersion "21.1.2"

defaultConfig {
    applicationId "com.example.manav.loginapp"
    minSdkVersion 21
    targetSdkVersion 24
    versionCode 1
    versionName "1.0"
}
buildTypes {
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    }
}

}

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:24.2.1'

compile 'com.android.support.constraint:constraint-layout:1.0.0-alpha1'

}

I want user to select a language inside the app. Once the language is selected, I want the strings to use the particular language.

If I change the phone language, then my app runs on the set language.

I am not able to find any way to set a language without changing the phone language. In addition, the changes should be reflected once the language is set.

Could anyone please suggest a way to do it?

The server runs in a console, and i should have to send a massage to the android app, witch appears in a text field. The consol - consol communication worked perfectly.

I use this server and this is the code from the client:

WebSocket4Net.WebSocket websocketClient;
websocketClient = new WebSocket4Net.WebSocket("ws://192.168.0.14:8001", "basic", WebSocketVersion.Rfc6455);
websocketClient.MessageReceived += new EventHandler<MessageReceivedEventArgs>(websocketClient_MessageReceived);

public void websocketClient_MessageReceived(object sender, MessageReceivedEventArgs e)
{
    SetContentView(Resource.Layout.Main);
    TextView txt = FindViewById<TextView>(Resource.Id.textView1);
    txt.Text = (e.Message);
}

And the problem still stends in vica versa, if i send a massage from client to server nothing happen.

I am creating a game in unity and I want to get the data of the people who installed my game. With regular android apps I can do it easly in android studio by just asking for permissions and send the relevant data to an online server.

But I have no idea how to do it with C# and unity. can you give me any help please?

And also some hints on how to do it wit iphone.

Thank you.

I have a pretty strange problem with a project. XCode gives me red errors all the time and says that my IBDesignables have a problem. But the error message differs every time and it's always another view controller affected. I have no idea how to find the cause of the problem. It seems to happen randomly with all IBDesignables I created.

The app does still work. Although, sometimes it doesn't render some views correctly (I have views with a custom drawn mask). It happens rarely, but it does happen.

These are errors I get:

"Failed to update the auto layout status: The agent crashed"

"Failed to render and update the auto layout status for {randomly chosen VC name}: The agent crashed"

The latter disappears as soon as I click on it. And sometimes, when I'm inside my storyboard, all of the errors go away. When I open any other file, I get multiple red errors (sometimes like 3, sometimes 6 or more).

I checked the crash logs. Every single one of them says:

fatal error: unexpectedly found nil while unwrapping an Optional value

I'm not sure what this means.

I tried cleaning the project and restarting XCode. Also, I implemented all of the init methods.

This following code is a class that (almost) always is part of the errors I get. Also, it's the custom drawn view that sometimes doesn't render correctly:

import UIKit

struct TriangleViewLabelDefault {
    static let triangleWidth: CGFloat = 20
    static let triangleHeight: CGFloat = 10
}

@IBDesignable
class TriangleView: UIView {
    let DEFAULT_TRIANGLE_WIDTH: CGFloat = 30
    let DEFAULT_TRIAGNLE_HEIGHT: CGFloat = 20


    struct Triangle {
        static var width: CGFloat = TriangleViewLabelDefault.triangleWidth
        static var height: CGFloat = TriangleViewLabelDefault.triangleHeight
        static var midXPosition: CGFloat = 0
    }

    @IBInspectable var triangleWidth: CGFloat = TriangleViewLabelDefault.triangleWidth {
        didSet {
            Triangle.width = triangleWidth
        }
    }

    @IBInspectable var triangleHeight: CGFloat = TriangleViewLabelDefault.triangleHeight {
        didSet {
            Triangle.height = triangleHeight
        }
    }

    @IBInspectable var relativePosition: Bool = true {
        didSet {
            setNeedsDisplay()
        }
    }

    @IBInspectable var triangleMidXOffset: CGFloat = 0 {
        didSet {
            setNeedsDisplay()
        }
    }

    @IBInspectable var decoration: Bool = true {
        didSet {
            setNeedsDisplay()
        }
    }

    @IBInspectable var lines: Int = 20 {
        didSet {
            setNeedsDisplay()
        }
    }

    override init(frame: CGRect) {
        super.init(frame: frame)
    }

    required init?(coder aDecoder: NSCoder) {
        super.init(coder: aDecoder)
    }

    override func draw(_ rect: CGRect) {
        super.draw(rect)
        calcTriangleMidXPosition()
        addLines()
        if decoration {
            addDecoration()
        }

        let maskLayer = CAShapeLayer()
        maskLayer.frame = bounds

        let maskPath = UIBezierPath()
        maskPath.move(to: CGPoint(x: 0, y: Triangle.height))
        /* Triangle */
        maskPath.addLine(to: CGPoint(x: Triangle.midXPosition - Triangle.width, y: Triangle.height))
        maskPath.addLine(to: CGPoint(x: Triangle.midXPosition, y: 0))
        maskPath.addLine(to: CGPoint(x: Triangle.midXPosition + Triangle.width, y: Triangle.height))
        /* */
        maskPath.addLine(to: CGPoint(x: bounds.size.width, y: Triangle.height))
        maskPath.addLine(to: CGPoint(x: bounds.size.width, y: bounds.size.height))
        maskPath.addLine(to: CGPoint(x: 0, y: bounds.size.height))
        maskPath.addLine(to: CGPoint(x: 0, y: Triangle.height))

        maskPath.close()

        maskLayer.path = maskPath.cgPath
        layer.mask = maskLayer
    }

    /// Evaluates the properties set in storyboard. This methods calculates the x-center of the triangle
    private func calcTriangleMidXPosition() {
        if relativePosition {
            Triangle.midXPosition = bounds.size.width / 2 + triangleMidXOffset * bounds.size.width / 2
        } else {
            Triangle.midXPosition = bounds.size.width / 2 + triangleMidXOffset
        }
    }

    private func addDecoration() {
        if let superview = superview {

            let topLine = UIView(frame: CGRect(x: 0, y: frame.minY + Triangle.height - 2, width: bounds.size.width, height: 1))
            let bottomLine = UIView(frame: CGRect(x: 0, y: frame.minY + Triangle.height - 4, width: bounds.size.width, height: 1))

            topLine.backgroundColor = UIColor.white
            bottomLine.backgroundColor = UIColor.white

            topLine.alpha = 0.5
            bottomLine.alpha = 0.2

            superview.insertSubview(topLine, belowSubview: self)
            superview.insertSubview(bottomLine, belowSubview: self)
        }
    }

    private func addLines() {

        guard lines > 0 else {
            return
        }

        let paddingLeft: Int = 20
        let lineLength: Int = 25

        let linesLayer = CAShapeLayer()
        linesLayer.frame = bounds

        let padding: CGFloat = 20

        let minY = Triangle.height + padding
        let maxY = bounds.height - padding
        let yArea = maxY - minY



        for x in 0...lines {
            let path = UIBezierPath()
            path.lineWidth = 3.0

            path.move(to: CGPoint(x: CGFloat(paddingLeft), y: minY + CGFloat(x) * yArea / CGFloat(lines)))
            path.addLine(to: CGPoint(x: CGFloat(paddingLeft) + CGFloat(lineLength), y: minY + CGFloat(x) * yArea / CGFloat(lines)))

            UIColor(red: 200.0/255.0, green: 200.0/255.0, blue: 200.0/255.0, alpha: 1.0).setStroke()
            path.stroke()
        }
    }
}

Thank you guys for any help!

I have decided to start building a SAAS app. I wish to keep hosting costs low initially, whilst still providing a good user experience. Here are the components that will make up my app:

- Front End
- Reverse Proxy (Nginx)
- Auth Service
- Web API 
- Worker Service A (processes data imports)
- Worker Service B (makes batches of external API calls)

All requests will go through the proxy, and auth will be handled via JWT.

I initially thought I would have all of these components on separate servers, but looking at hosting providers and pricing, that seems like an expensive option starting out (especially with 0 paying customers).

So it seems a cost effective way to do this would be to use a single server. Essentially each component would just be a separate piece of isolated code. Using this approach, I would still use the reverse proxy, and still use JWTs for auth - I feel like that way everything can be moved to separate servers more easily in the future.

What are the drawbacks of a single server approach like this (aside from the obvious monolithic negatives)?

Assuming this is an acceptable approach starting out, is using a service like Elastic Beanstalk enough in terms of handling High Availability?

I am working on developing an HTML canvas application, where I need to be able to do my own UI event processing. That's where the stem of this question comes from, but I'd really like to understand how the whole process works.

I've managed to find out that typically events will capture or tunnel town, and then bubble back up, but that's as far as I've managed to get.

Note: I am familiar with the Observer pattern, that's not what I'm asking for on 2 and 5.

So, I'm looking for the correct way to:

  1. Send the event down to the correct child
  2. Call subscribers to the event, if they exists
  3. Stop processing when it's appropriate
  4. Bubbling back up to the caller
  5. Calling the subscribers to the bubble event, if they exist.

For #1, what I've come up with seems a bit rudimentary. Is there a better way?

for child in children
    if child.containsPoint(x, y)
         // Do stuff

For #2, I understand how observers and subscribers work, but how do I differentiate between tunneling down, and calling a handler if one has been subscribed. Because, I may have a parent element which does not do anything with say, the mouse move event, but it still needs to send it to the child below it, if there is one.


For #3, I've seen this often where the event data has a Handled property. However, how do I get if it's been handled. If there are many subscribers to an event, do they get called one by one, and each time the Handled property is checked, and if it comes back true, then stop looping? Also, should I bubble back up if a tunnel event handles something?


For #4, typically there is a property or parameter which specifies the originating object. So, if I tunnel from A -> B -> C, then C is what is held in that property. So then, when I'm at B, getting C's bubble, how do I know to call back up to A?


For #5, this is pretty much the same as #2, it's just here in case it's different.



I'm really hoping there are some patterns which define how to do all of this well, but apparently my Googling skills were not up to par to be able to find them if there are.

I want my website to accessible through its IP Address, how do I achieve that?

What happens is when I type-in the IP address in the URL it redirects to the website name, that’s something I dont want to happen. I just want some of our users to access the website through an IP address without it redirecting to the actual site name. At the same time people should still be able to access the website using the web address, I actually want both options to work.

I have a dedicated IP address for my site, not a shared one.

Does someone have a solution or a work around for this?

Anyone who has a solution? Any web gurus out there, please?

Thank you in advance.

Look forward.

Best, Krypto.

Just as title said, I want to show a dialog, and called dialog.show() function. Strange problem is: In some phone, such as xiaomi2 and some huawei, the dialog not show, but can get touch events(like onclick event, so it has shown, but can't be visible). Its weird!!

more: The dialog is above on a GlSurfaceView, but I don't think it the problem, because other view above on the GlSurfaceView is visible, and other phone is also fine.

Thanks.

In my app the main activity is a recyclerview that contains a list of custom objects (recipes in this case). Whenever I create a new recipe (my object) and save it, the first object I created seems to be deleted and replaced with this new entry. Here is the code from the main activity:

package groceryproject.jacob.com.recipelist;

import android.content.Intent;
import android.os.Parcelable;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.view.View;
import android.view.Window;
import android.widget.Button;
import android.view.View.OnClickListener;
import android.content.Intent;
import android.widget.RelativeLayout;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

public class RecipeList extends AppCompatActivity{
    private RecyclerView mRecyclerView;
    private RecyclerView.Adapter mAdapter;
    private RecyclerView.LayoutManager mLayoutManager;
    ArrayList<Recipe> recipes = new ArrayList<>();
    Recipe passedRecipe = new Recipe();

    //TODO: Fix bug: Newly created recipes replace each other
    protected void onCreate(Bundle savedInstanceState) {

        /*
        for (int i = 0; i < 1; i++){
            Recipe recipe = new Recipe();
            recipe.setRecipeName("Recipe #" + i);
            recipe.setPrepTime(i);
            recipe.setCookTime(i);
            recipe.setServingSize(i + " slices");
            ArrayList<String> ingredientsTest = new ArrayList<String>();
            ArrayList<String> directionsTest = new ArrayList<String>();
            for(int j = 0; j < 5; j++){
                ingredientsTest.add("Test Ingredient: " + j);
                directionsTest.add("Test Direction: " + j);
            }
            recipe.setIngredients(ingredientsTest);
            recipe.setDirections(directionsTest);
            recipes.add(recipe);
        }
        */

        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_recipe_list);
        mRecyclerView = (RecyclerView) findViewById(R.id.list_recycler_view);

        if(mLayoutManager == null) {
            mLayoutManager = new LinearLayoutManager(this);
            mRecyclerView.setLayoutManager(mLayoutManager);
        }

        if (mAdapter == null) {
            mAdapter = new MyAdapter(recipes);
            mRecyclerView.setAdapter(mAdapter);
        }

        if (getIntent().getExtras() != null){
            if (getIntent().getExtras().containsKey("recipe_key")){
                passedRecipe = (Recipe) getIntent().getSerializableExtra("recipe_key");
                recipes.add(passedRecipe);
                mAdapter.notifyDataSetChanged();

            }
        }

        //This button creates a new empty Recipe object and passes it to the EditRecipe class
        //The Recipe object is passed as a serializable
        Button mCreateRecipeButton = (Button) findViewById(R.id.create_new_recipe_button);
        mCreateRecipeButton.setOnClickListener(new View.OnClickListener(){
            public void onClick(View v){
                //Create a new empty recipe to be passed to the EditRecipe class
                Recipe passedRecipe = new Recipe();
                Intent i = new Intent(RecipeList.this, EditRecipe.class);
                i.putExtra("passed_recipe_key", (Serializable) passedRecipe);
                RecipeList.this.startActivity(i);
            }
        });

    }
}

Code for the adapter:

package groceryproject.jacob.com.recipelist;

/**
 * Created by Jacob on 9/27/2016.
 */
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

import android.content.Context;
import android.content.Intent;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.ViewGroup;
import android.widget.RelativeLayout;
import android.widget.TextView;

import org.w3c.dom.Text;

//TODO: Rename this to something more relevant instead of MyAdapter
//TODO: Create a delete button
public class MyAdapter extends RecyclerView.Adapter<MyAdapter.ViewHolder>{

    private List<Recipe> mRecipeSet;

    public MyAdapter(List<Recipe> recipes){
        mRecipeSet = recipes;
    }

    // Provide a reference to the views for each data item
    // Complex data items may need more than one view per item, and
    // you provide access to all the views for a data item in a view holder
    public class ViewHolder extends RecyclerView.ViewHolder implements View.OnClickListener {

        //This is what will handle what happens when you click a recipe in the recycler view
        @Override
        public void onClick(View v){
            int position = getAdapterPosition();
            Intent i = new Intent(v.getContext(), RecipeTextView.class);
            Recipe selectedRecipe = mRecipeSet.get(position);
            i.putExtra("view_recipe_key", (Serializable) selectedRecipe);
            //Every view has a context, and to start the activity I must get that context
            v.getContext().startActivity(i);
        }

        public TextView mRecipeName;
        public TextView mPrepTime;
        public TextView mCookTime;
        public TextView mServingSize;
        public RelativeLayout mRecipeTextSection;


        public ViewHolder(View v) {
            super(v);
            mRecipeName = (TextView) v.findViewById(R.id.recipe_list_recycler_view_recipe_name);
            mServingSize = (TextView) v.findViewById(R.id.recipe_list_recycler_view_serving_size);
            mPrepTime = (TextView) v.findViewById(R.id.recipe_list_recycler_view_prep_time);
            mCookTime = (TextView) v.findViewById(R.id.recipe_list_recycler_view_cook_time);
            mRecipeTextSection = (RelativeLayout) v.findViewById(R.id.recycled_item_section_view);

            mRecipeTextSection.setOnClickListener(this);

        }
    }


    public void add(int position, Recipe item) {
        mRecipeSet.add(position, item);
        notifyItemInserted(position);
    }

    public void remove(Recipe item) {
        int position = mRecipeSet.indexOf(item);
        mRecipeSet.remove(position);
        notifyItemRemoved(position);
    }


    public MyAdapter(ArrayList<Recipe> myRecipeset) {
        mRecipeSet = myRecipeset;
    }

    // Create new views (invoked by the layout manager)
    @Override
    public MyAdapter.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
        // create a new view
        View v = LayoutInflater.from(parent.getContext()).inflate(R.layout.recipe_item_recycled, parent, false);
        ViewHolder vh = new ViewHolder(v);
        return vh;
    }

    //This is the code that controls what goes into the view.
    //TODO: Edit this code to control the placement of each element of a recipe in the recycler.
    // Replace the contents of a view (invoked by the layout manager)
    @Override
    public void onBindViewHolder(ViewHolder holder, int position) {
        Recipe recipe = mRecipeSet.get(position);
        String recipeName = recipe.getRecipeName();
        String prepTime = "Prep Time: " + String.valueOf(recipe.getPrepTime()) + " minutes";
        String cookTime = "Cook Time: " + String.valueOf(recipe.getCookTime()) + " minutes";
        String servingSize = "Serves: " + String.valueOf(recipe.getServings());

        holder.mRecipeName.setText(recipeName);
        holder.mServingSize.setText(servingSize);
        holder.mPrepTime.setText(prepTime);
        holder.mCookTime.setText(cookTime);


    }

    // Return the size of your dataset (invoked by the layout manager)
    @Override
    public int getItemCount() {
        return mRecipeSet.size();
    }



}

And finally code for which the object is edited:

package groceryproject.jacob.com.recipelist;

import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.text.Editable;
import android.text.Selection;
import android.text.TextUtils;
import android.text.TextWatcher;
import android.util.Log;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

//This class is used to edit a recipe. Editing includes both creating a new recipe and editing an existing one
//The edit and create button are in RecipeTextView (Edit) and RecipeList (Create)
public class EditRecipe extends AppCompatActivity {
    private final String TAG = "myApp";
    private EditText mRecipeName;
    private EditText mServings;
    private EditText mPrepTime;
    private EditText mIngredients;
    private EditText mDirections;
    private Button mSaveButton;
    private EditText mCookTime;

    //These are declared here so that I can use them within each edit text listener, and then set them to the values
    //of the recipe object when the save button is pushed.

    private String recipeName;
    private String prepTime;
    private String cookTime;
    private String servings;
    //For directions and ingredients, we will seperate these into a list of strings by \n (new line).
    private String directions;
    private String ingredients;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        Log.d(TAG, "onCreate() called");
        setContentView(R.layout.activity_edit_recipe);

        final Recipe passedRecipe = (Recipe) getIntent().getSerializableExtra("passed_recipe_key");

        mRecipeName = (EditText) findViewById(R.id.recipe_name_text_edit);
        mPrepTime = (EditText) findViewById(R.id.prep_time_edit_text);
        mCookTime = (EditText) findViewById(R.id.cook_time_edit_text);
        mServings = (EditText) findViewById(R.id.serving_edit_text);
        mIngredients = (EditText) findViewById(R.id.ingredients_edit_text);
        mDirections = (EditText) findViewById(R.id.directions_edit_text);
        mSaveButton = (Button) findViewById(R.id.save_edit_recipe_button);

        //TODO: Make preptime and cook time strings, then change it to null.
        //The following if statements will only be triggered if this class is accessed from editing an
        //already existing recipe. Otherwise a new recipe is created.
        if(passedRecipe.getRecipeName() != null){
            mRecipeName.setText(passedRecipe.getRecipeName(), TextView.BufferType.EDITABLE);
        }
        if(passedRecipe.getPrepTime() != null){
            mPrepTime.setText(passedRecipe.getPrepTime(), TextView.BufferType.EDITABLE);
        }
        if(passedRecipe.getCookTime() != null){
            mCookTime.setText(passedRecipe.getCookTime(), TextView.BufferType.EDITABLE);
        }
        if(passedRecipe.getServings() != null){
            mServings.setText(passedRecipe.getServings(), TextView.BufferType.EDITABLE);
        }
        //For the array list values, we check if the array list is empty
        //If it isn't empty, we save each value of the array list into a string concatenated with a new line
        //We then set that string as the new line
        if(passedRecipe.getIngredients() != null){
            String passedIngredientString = "";
            for(int i = 0; i < passedRecipe.getIngredients().size(); i++){
                passedIngredientString += passedRecipe.getIngredients().get(i) + "\n";
            }
            mIngredients.setText(passedIngredientString, TextView.BufferType.EDITABLE);
        }
        if(passedRecipe.getDirections() != null){
            String passedDirectionString = "";
            for(int i = 0; i < passedRecipe.getDirections().size(); i++){
                passedDirectionString += passedRecipe.getDirections().get(i) + "\n";
            }
            mDirections.setText(passedDirectionString, TextView.BufferType.EDITABLE);
        }



        //In the following Listeners I use .trim at the end to get rid of white space users tend to leave
        //For the integer values I first store the data in a string then parse it to an int.
        mRecipeName.addTextChangedListener(new TextWatcher() {
            @Override
            public void beforeTextChanged(CharSequence s, int start, int count, int after) {

            }

            @Override
            public void onTextChanged(CharSequence s, int start, int before, int count) {
                recipeName = mRecipeName.getText().toString().trim();

            }

            @Override
            public void afterTextChanged(Editable s) {

            }
        });

        mPrepTime.addTextChangedListener(new TextWatcher() {
            @Override
            public void beforeTextChanged(CharSequence s, int start, int count, int after) {

            }

            @Override
            public void onTextChanged(CharSequence s, int start, int before, int count) {
                String prepString = mPrepTime.getText().toString().trim();
                prepTime = prepString;
            }

            @Override
            public void afterTextChanged(Editable s) {

            }
        });

        mServings.addTextChangedListener(new TextWatcher() {
            @Override
            public void beforeTextChanged(CharSequence s, int start, int count, int after) {

            }

            @Override
            public void onTextChanged(CharSequence s, int start, int before, int count) {
                String servingString = mServings.getText().toString().trim();
                servings = servingString;
            }

            @Override
            public void afterTextChanged(Editable s) {

            }
        });

        mCookTime.addTextChangedListener(new TextWatcher() {
            @Override
            public void beforeTextChanged(CharSequence s, int start, int count, int after) {

            }

            @Override
            public void onTextChanged(CharSequence s, int start, int before, int count) {
                String cookTimeString = mCookTime.getText().toString().trim();
                cookTime = cookTimeString;
            }

            @Override
            public void afterTextChanged(Editable s) {

            }
        });

        mDirections.addTextChangedListener(new TextWatcher() {
            @Override
            public void beforeTextChanged(CharSequence s, int start, int count, int after) {

            }

            @Override
            public void onTextChanged(CharSequence s, int start, int before, int count) {
                //For now we will save this in a string, then seperate each line into an array list.
                directions = mDirections.getText().toString().trim();


            }

            @Override
            public void afterTextChanged(Editable s) {

            }
        });

        mIngredients.addTextChangedListener(new TextWatcher() {
            @Override
            public void beforeTextChanged(CharSequence s, int start, int count, int after) {

            }

            @Override
            public void onTextChanged(CharSequence s, int start, int before, int count) {
                //For now we will save this in a string, then seperate each line into an array list.
                ingredients = mIngredients.getText().toString().trim();
            }

            @Override
            public void afterTextChanged(Editable s) {

            }
        });


        //TODO: Pass the created object back to the RecipeList Class when save is pressed
        mSaveButton.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                //If statement to make sure the recipe name exists. Every other value can be empty
                //if the user wishes
                if (TextUtils.isEmpty(recipeName)){
                    mRecipeName.setError("Recipe name can not be empty.");
                    return;
                }

                passedRecipe.setRecipeName(recipeName);
                passedRecipe.setCookTime(cookTime);
                passedRecipe.setPrepTime(prepTime);
                passedRecipe.setServingSize(servings);

                //Save each line of the strings directions and ingredients into an array list
                List<String> directionsList = Arrays.asList(directions.split("\n"));
                List<String> ingredientsList = Arrays.asList(ingredients.split("\n"));

                passedRecipe.setDirections(directionsList);
                passedRecipe.setIngredients(ingredientsList);

                Intent i = new Intent(EditRecipe.this, RecipeList.class);
                i.putExtra("recipe_key", (Serializable) passedRecipe);
                EditRecipe.this.startActivity(i);


            }
        });
    }


}

I'm pretty confident the issue is in the onCreate method of RecipeList, and I figured maybe I'm recreating the list every time that class is run, but I'm not sure how to correct that. The adapter was hard enough for me to get working so I still don't fully understand how everything works in that class.

I have a for loop in there that's commented out that was used to create fake data to test the app, and the list worked fine with that loop.

I've made an app using the Kivy cross-platform tool and I built the apk file using python-for-android. I want to store a secret-key locally in the application but since the apk file can be disassembled, How can I make sure my secret-key is safe?

I am showing the distance from the car to the last point and current distance. The results are little bit weird. If a car passing through a point, so from a distance of 3M becomes 1,600M. How is that even possible?

position.distanceTo(point);
last_position.distanceTo(point);

Locations are correct...

Can someone say me how to fix it? Thanks!

DISTANCE: 25.681800842285156; LAST_DISTANCE: 37.73990249633789
DISTANCE: 13.969769477844238; LAST_DISTANCE: 25.681800842285156
DISTANCE: 3.0865213871002197; LAST_DISTANCE: 13.969769477844238
DISTANCE: 1679.0194091796875; LAST_DISTANCE: 1691.07275390625
DISTANCE: 1666.6763916015625; LAST_DISTANCE: 1679.0194091796875

Distance CCA 5 Meters:

enter image description here

Distance CCA 1600 METERS - WTF?

enter image description here

It NOT happens all the time, just sometimes.

I'm very new to Android Studio and I'm basically trying to open an existing project that I had downloaded and compile/run it. I am getting the following error when Gradle attempts to sync...

Error:Cannot read packageName from /Users/Amanda/Desktop/MyProject/src/main/AndroidManifest.xml

I have researched online and have tried several solutions, none of which have fixed my problem :/ I have also tried to "invalidate caches and restart" but it did not work either...

This is my Manifest:

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="me.amanda.myproject.app">
    <application
        android:allowBackup="true"
        android:icon="@drawable/ic_launcher"
        android:label="@string/app_name"
        android:theme="@style/AppTheme">
        <activity
            android:name=".MainActivity"
            android:label="My Project">
            <intent-filter>
                <action android:name="android.intent.action.MAIN"/>
                <category android:name="android.intent.category.LAUNCHER"/>
            </intent-filter>
        </activity>
        <activity
            android:name=".resourceListing"
            android:label="My App Listing">
        </activity>
        <activity
            android:name=".ListApps"
            android:label="@string/title_activity_list_apps">
        </activity>
    </application>
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
    <uses-permission android:name="android.permission.INTERNET"/>
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
    <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
</manifest>

My build.gradle:

buildscript {
    repositories {
       jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:2.2.0'

        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}
apply plugin: 'com.android.application'

allprojects {
    repositories {
        mavenCentral()
    }
}

android {
    compileSdkVersion 23
    buildToolsVersion "23.0.2"

}
dependencies {
}

I need to connect several android devices to an Intel Edison via WiFi or blueetooth (WiFi prefered), i'm using the XDK IDE (javascript) for my project, but i can't find a proper example to do this, the devices will act as sensors and will send data to the Edison board constantly, then the program on the board will do some calculations and will send back information.

How do I prevent TabBarLayout from going under StatusBar?

FYI: I set my CollapsingToolBar to scroll|enterAlwaysCollapsed. And I set the ToolBar to snap|exitUntilCollapsed.

Here is my build environment: I build android N on my mac using case-sensitive image. On the same image, I can successfully android 5.0.1 for nexus5. Now I want to do that for nexus 6p using android 7.0.0_r6. Repo sync is successful.

There are multiple errors:

1

Unknown option: -C
usage: git [--version] [--help] [-c name=value]
           [--exec-path[=<path>]] [--html-path] [--man-path] [--info-path]
           [-p|--paginate|--no-pager] [--no-replace-objects] [--bare]
           [--git-dir=<path>] [--work-tree=<path>] [--namespace=<name>]
           <command> [<args>]

2

localhost:n_android guest$ make -j12
date: 1475895550: No such file or directory
date: 1475895550: No such file or directory

3

build/kati/eval.h:18:10: fatal error: 'unordered_map' file not found

From the full log below, the first issue is in "lunch" command. Has anybody seen this kind of error? Any comment is welcome! Thanks!

localhost:n_android guest$ source build/envsetup.sh 
including device/asus/fugu/vendorsetup.sh
including device/generic/mini-emulator-arm64/vendorsetup.sh
including device/generic/mini-emulator-armv7-a-neon/vendorsetup.sh
including device/generic/mini-emulator-mips/vendorsetup.sh
including device/generic/mini-emulator-mips64/vendorsetup.sh
including device/generic/mini-emulator-x86/vendorsetup.sh
including device/generic/mini-emulator-x86_64/vendorsetup.sh
including device/google/dragon/vendorsetup.sh
including device/htc/flounder/vendorsetup.sh
including device/huawei/angler/vendorsetup.sh
including device/lge/bullhead/vendorsetup.sh
including device/linaro/hikey/vendorsetup.sh
including device/moto/shamu/vendorsetup.sh
including sdk/bash_completion/adb.bash
localhost:n_android guest$ lunch aosp_angler-userdebug 
date: 1475895540: No such file or directory
date: 1475895540: No such file or directory

============================================
PLATFORM_VERSION_CODENAME=REL
PLATFORM_VERSION=7.0
TARGET_PRODUCT=aosp_angler
TARGET_BUILD_VARIANT=userdebug
TARGET_BUILD_TYPE=release
TARGET_BUILD_APPS=
TARGET_ARCH=arm64
TARGET_ARCH_VARIANT=armv8-a
TARGET_CPU_VARIANT=cortex-a53
TARGET_2ND_ARCH=arm
TARGET_2ND_ARCH_VARIANT=armv7-a-neon
TARGET_2ND_CPU_VARIANT=cortex-a53.a57
HOST_ARCH=x86_64
HOST_2ND_ARCH=x86
HOST_OS=darwin
HOST_OS_EXTRA=Darwin-15.3.0-x86_64-i386-64bit
HOST_CROSS_OS=
HOST_CROSS_ARCH=
HOST_CROSS_2ND_ARCH=
HOST_BUILD_TYPE=release
BUILD_ID=NRD90U
OUT_DIR=out
============================================
localhost:n_android guest$ make -j12
date: 1475895550: No such file or directory
date: 1475895550: No such file or directory
============================================
PLATFORM_VERSION_CODENAME=REL
PLATFORM_VERSION=7.0
TARGET_PRODUCT=aosp_angler
TARGET_BUILD_VARIANT=userdebug
TARGET_BUILD_TYPE=release
TARGET_BUILD_APPS=
TARGET_ARCH=arm64
TARGET_ARCH_VARIANT=armv8-a
TARGET_CPU_VARIANT=cortex-a53
TARGET_2ND_ARCH=arm
TARGET_2ND_ARCH_VARIANT=armv7-a-neon
TARGET_2ND_CPU_VARIANT=cortex-a53.a57
HOST_ARCH=x86_64
HOST_2ND_ARCH=x86
HOST_OS=darwin
HOST_OS_EXTRA=Darwin-15.3.0-x86_64-i386-64bit
HOST_CROSS_OS=
HOST_CROSS_ARCH=
HOST_CROSS_2ND_ARCH=
HOST_BUILD_TYPE=release
BUILD_ID=NRD90U
OUT_DIR=out
============================================
Unknown option: -C
usage: git [--version] [--help] [-c name=value]
           [--exec-path[=<path>]] [--html-path] [--man-path] [--info-path]
           [-p|--paginate|--no-pager] [--no-replace-objects] [--bare]
           [--git-dir=<path>] [--work-tree=<path>] [--namespace=<name>]
           <command> [<args>]
prebuilts/clang/host/darwin-x86/clang-2690385/bin/clang++   -fno-exceptions -Wno-multichar -m64 -D__STDC_FORMAT_MACROS -D__STDC_CONSTANT_MACROS -isysroot /Applications/Xcode-5.0.2.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk -mmacosx-version-min=10.8 -DMACOSX_DEPLOYMENT_TARGET=10.8 -fPIC -funwind-tables -DANDROID -fmessage-length=0 -W -Wall -Wno-unused -Winit-self -Wpointer-arith -O2 -g -fno-strict-aliasing -DNDEBUG -UDEBUG  -D__compiler_offsetof=__builtin_offsetof -Werror=int-conversion -Wno-reserved-id-macro -Wno-format-pedantic -Wno-unused-command-line-argument   -integrated-as -fstack-protector-strong    -integrated-as -target x86_64-apple-darwin   -isystem /Applications/Xcode-5.0.2.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1 -Wsign-promo  -Wno-inconsistent-missing-override    -target x86_64-apple-darwin -c -std=c++11 -g -W -Wall -MMD -MP -O -DNOLOG -march=native -o out/host/darwin-x86/obj/EXECUTABLES/ckati_intermediates/dep.o build/kati/dep.cc
prebuilts/clang/host/darwin-x86/clang-2690385/bin/clang++   -fno-exceptions -Wno-multichar -m64 -D__STDC_FORMAT_MACROS -D__STDC_CONSTANT_MACROS -isysroot /Applications/Xcode-5.0.2.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk -mmacosx-version-min=10.8 -DMACOSX_DEPLOYMENT_TARGET=10.8 -fPIC -funwind-tables -DANDROID -fmessage-length=0 -W -Wall -Wno-unused -Winit-self -Wpointer-arith -O2 -g -fno-strict-aliasing -DNDEBUG -UDEBUG  -D__compiler_offsetof=__builtin_offsetof -Werror=int-conversion -Wno-reserved-id-macro -Wno-format-pedantic -Wno-unused-command-line-argument   -integrated-as -fstack-protector-strong    -integrated-as -target x86_64-apple-darwin   -isystem /Applications/Xcode-5.0.2.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1 -Wsign-promo  -Wno-inconsistent-missing-override    -target x86_64-apple-darwin -c -std=c++11 -g -W -Wall -MMD -MP -O -DNOLOG -march=native -o out/host/darwin-x86/obj/EXECUTABLES/ckati_intermediates/eval.o build/kati/eval.cc
prebuilts/clang/host/darwin-x86/clang-2690385/bin/clang++   -fno-exceptions -Wno-multichar -m64 -D__STDC_FORMAT_MACROS -D__STDC_CONSTANT_MACROS -isysroot /Applications/Xcode-5.0.2.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk -mmacosx-version-min=10.8 -DMACOSX_DEPLOYMENT_TARGET=10.8 -fPIC -funwind-tables -DANDROID -fmessage-length=0 -W -Wall -Wno-unused -Winit-self -Wpointer-arith -O2 -g -fno-strict-aliasing -DNDEBUG -UDEBUG  -D__compiler_offsetof=__builtin_offsetof -Werror=int-conversion -Wno-reserved-id-macro -Wno-format-pedantic -Wno-unused-command-line-argument   -integrated-as -fstack-protector-strong    -integrated-as -target x86_64-apple-darwin   -isystem /Applications/Xcode-5.0.2.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1 -Wsign-promo  -Wno-inconsistent-missing-override    -target x86_64-apple-darwin -c -std=c++11 -g -W -Wall -MMD -MP -O -DNOLOG -march=native -o out/host/darwin-x86/obj/EXECUTABLES/ckati_intermediates/exec.o build/kati/exec.cc
prebuilts/clang/host/darwin-x86/clang-2690385/bin/clang++   -fno-exceptions -Wno-multichar -m64 -D__STDC_FORMAT_MACROS -D__STDC_CONSTANT_MACROS -isysroot /Applications/Xcode-5.0.2.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk -mmacosx-version-min=10.8 -DMACOSX_DEPLOYMENT_TARGET=10.8 -fPIC -funwind-tables -DANDROID -fmessage-length=0 -W -Wall -Wno-unused -Winit-self -Wpointer-arith -O2 -g -fno-strict-aliasing -DNDEBUG -UDEBUG  -D__compiler_offsetof=__builtin_offsetof -Werror=int-conversion -Wno-reserved-id-macro -Wno-format-pedantic -Wno-unused-command-line-argument   -integrated-as -fstack-protector-strong    -integrated-as -target x86_64-apple-darwin   -isystem /Applications/Xcode-5.0.2.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1 -Wsign-promo  -Wno-inconsistent-missing-override    -target x86_64-apple-darwin -c -std=c++11 -g -W -Wall -MMD -MP -O -DNOLOG -march=native -o out/host/darwin-x86/obj/EXECUTABLES/ckati_intermediates/file.o build/kati/file.cc
prebuilts/clang/host/darwin-x86/clang-2690385/bin/clang++   -fno-exceptions -Wno-multichar -m64 -D__STDC_FORMAT_MACROS -D__STDC_CONSTANT_MACROS -isysroot /Applications/Xcode-5.0.2.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk -mmacosx-version-min=10.8 -DMACOSX_DEPLOYMENT_TARGET=10.8 -fPIC -funwind-tables -DANDROID -fmessage-length=0 -W -Wall -Wno-unused -Winit-self -Wpointer-arith -O2 -g -fno-strict-aliasing -DNDEBUG -UDEBUG  -D__compiler_offsetof=__builtin_offsetof -Werror=int-conversion -Wno-reserved-id-macro -Wno-format-pedantic -Wno-unused-command-line-argument   -integrated-as -fstack-protector-strong    -integrated-as -target x86_64-apple-darwin   -isystem /Applications/Xcode-5.0.2.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1 -Wsign-promo  -Wno-inconsistent-missing-override    -target x86_64-apple-darwin -c -std=c++11 -g -W -Wall -MMD -MP -O -DNOLOG -march=native -o out/host/darwin-x86/obj/EXECUTABLES/ckati_intermediates/file_cache.o build/kati/file_cache.cc
prebuilts/clang/host/darwin-x86/clang-2690385/bin/clang++   -fno-exceptions -Wno-multichar -m64 -D__STDC_FORMAT_MACROS -D__STDC_CONSTANT_MACROS -isysroot /Applications/Xcode-5.0.2.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk -mmacosx-version-min=10.8 -DMACOSX_DEPLOYMENT_TARGET=10.8 -fPIC -funwind-tables -DANDROID -fmessage-length=0 -W -Wall -Wno-unused -Winit-self -Wpointer-arith -O2 -g -fno-strict-aliasing -DNDEBUG -UDEBUG  -D__compiler_offsetof=__builtin_offsetof -Werror=int-conversion -Wno-reserved-id-macro -Wno-format-pedantic -Wno-unused-command-line-argument   -integrated-as -fstack-protector-strong    -integrated-as -target x86_64-apple-darwin   -isystem /Applications/Xcode-5.0.2.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1 -Wsign-promo  -Wno-inconsistent-missing-override    -target x86_64-apple-darwin -c -std=c++11 -g -W -Wall -MMD -MP -O -DNOLOG -march=native -o out/host/darwin-x86/obj/EXECUTABLES/ckati_intermediates/expr.o build/kati/expr.cc
prebuilts/clang/host/darwin-x86/clang-2690385/bin/clang++   -fno-exceptions -Wno-multichar -m64 -D__STDC_FORMAT_MACROS -D__STDC_CONSTANT_MACROS -isysroot /Applications/Xcode-5.0.2.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk -mmacosx-version-min=10.8 -DMACOSX_DEPLOYMENT_TARGET=10.8 -fPIC -funwind-tables -DANDROID -fmessage-length=0 -W -Wall -Wno-unused -Winit-self -Wpointer-arith -O2 -g -fno-strict-aliasing -DNDEBUG -UDEBUG  -D__compiler_offsetof=__builtin_offsetof -Werror=int-conversion -Wno-reserved-id-macro -Wno-format-pedantic -Wno-unused-command-line-argument   -integrated-as -fstack-protector-strong    -integrated-as -target x86_64-apple-darwin   -isystem /Applications/Xcode-5.0.2.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1 -Wsign-promo  -Wno-inconsistent-missing-override    -target x86_64-apple-darwin -c -std=c++11 -g -W -Wall -MMD -MP -O -DNOLOG -march=native -o out/host/darwin-x86/obj/EXECUTABLES/ckati_intermediates/command.o build/kati/command.cc
prebuilts/clang/host/darwin-x86/clang-2690385/bin/clang++   -fno-exceptions -Wno-multichar -m64 -D__STDC_FORMAT_MACROS -D__STDC_CONSTANT_MACROS -isysroot /Applications/Xcode-5.0.2.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk -mmacosx-version-min=10.8 -DMACOSX_DEPLOYMENT_TARGET=10.8 -fPIC -funwind-tables -DANDROID -fmessage-length=0 -W -Wall -Wno-unused -Winit-self -Wpointer-arith -O2 -g -fno-strict-aliasing -DNDEBUG -UDEBUG  -D__compiler_offsetof=__builtin_offsetof -Werror=int-conversion -Wno-reserved-id-macro -Wno-format-pedantic -Wno-unused-command-line-argument   -integrated-as -fstack-protector-strong    -integrated-as -target x86_64-apple-darwin   -isystem /Applications/Xcode-5.0.2.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1 -Wsign-promo  -Wno-inconsistent-missing-override    -target x86_64-apple-darwin -c -std=c++11 -g -W -Wall -MMD -MP -O -DNOLOG -march=native -o out/host/darwin-x86/obj/EXECUTABLES/ckati_intermediates/find.o build/kati/find.cc
prebuilts/clang/host/darwin-x86/clang-2690385/bin/clang++   -fno-exceptions -Wno-multichar -m64 -D__STDC_FORMAT_MACROS -D__STDC_CONSTANT_MACROS -isysroot /Applications/Xcode-5.0.2.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk -mmacosx-version-min=10.8 -DMACOSX_DEPLOYMENT_TARGET=10.8 -fPIC -funwind-tables -DANDROID -fmessage-length=0 -W -Wall -Wno-unused -Winit-self -Wpointer-arith -O2 -g -fno-strict-aliasing -DNDEBUG -UDEBUG  -D__compiler_offsetof=__builtin_offsetof -Werror=int-conversion -Wno-reserved-id-macro -Wno-format-pedantic -Wno-unused-command-line-argument   -integrated-as -fstack-protector-strong    -integrated-as -target x86_64-apple-darwin   -isystem /Applications/Xcode-5.0.2.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1 -Wsign-promo  -Wno-inconsistent-missing-override    -target x86_64-apple-darwin -c -std=c++11 -g -W -Wall -MMD -MP -O -DNOLOG -march=native -o out/host/darwin-x86/obj/EXECUTABLES/ckati_intermediates/fileutil.o build/kati/fileutil.cc
prebuilts/clang/host/darwin-x86/clang-2690385/bin/clang++   -fno-exceptions -Wno-multichar -m64 -D__STDC_FORMAT_MACROS -D__STDC_CONSTANT_MACROS -isysroot /Applications/Xcode-5.0.2.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk -mmacosx-version-min=10.8 -DMACOSX_DEPLOYMENT_TARGET=10.8 -fPIC -funwind-tables -DANDROID -fmessage-length=0 -W -Wall -Wno-unused -Winit-self -Wpointer-arith -O2 -g -fno-strict-aliasing -DNDEBUG -UDEBUG  -D__compiler_offsetof=__builtin_offsetof -Werror=int-conversion -Wno-reserved-id-macro -Wno-format-pedantic -Wno-unused-command-line-argument   -integrated-as -fstack-protector-strong    -integrated-as -target x86_64-apple-darwin   -isystem /Applications/Xcode-5.0.2.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1 -Wsign-promo  -Wno-inconsistent-missing-override    -target x86_64-apple-darwin -c -std=c++11 -g -W -Wall -MMD -MP -O -DNOLOG -march=native -o out/host/darwin-x86/obj/EXECUTABLES/ckati_intermediates/affinity.o build/kati/affinity.cc
prebuilts/clang/host/darwin-x86/clang-2690385/bin/clang++   -fno-exceptions -Wno-multichar -m64 -D__STDC_FORMAT_MACROS -D__STDC_CONSTANT_MACROS -isysroot /Applications/Xcode-5.0.2.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk -mmacosx-version-min=10.8 -DMACOSX_DEPLOYMENT_TARGET=10.8 -fPIC -funwind-tables -DANDROID -fmessage-length=0 -W -Wall -Wno-unused -Winit-self -Wpointer-arith -O2 -g -fno-strict-aliasing -DNDEBUG -UDEBUG  -D__compiler_offsetof=__builtin_offsetof -Werror=int-conversion -Wno-reserved-id-macro -Wno-format-pedantic -Wno-unused-command-line-argument   -integrated-as -fstack-protector-strong    -integrated-as -target x86_64-apple-darwin   -isystem /Applications/Xcode-5.0.2.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1 -Wsign-promo  -Wno-inconsistent-missing-override    -target x86_64-apple-darwin -c -std=c++11 -g -W -Wall -MMD -MP -O -DNOLOG -march=native -o out/host/darwin-x86/obj/EXECUTABLES/ckati_intermediates/flags.o build/kati/flags.cc
prebuilts/clang/host/darwin-x86/clang-2690385/bin/clang++   -fno-exceptions -Wno-multichar -m64 -D__STDC_FORMAT_MACROS -D__STDC_CONSTANT_MACROS -isysroot /Applications/Xcode-5.0.2.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk -mmacosx-version-min=10.8 -DMACOSX_DEPLOYMENT_TARGET=10.8 -fPIC -funwind-tables -DANDROID -fmessage-length=0 -W -Wall -Wno-unused -Winit-self -Wpointer-arith -O2 -g -fno-strict-aliasing -DNDEBUG -UDEBUG  -D__compiler_offsetof=__builtin_offsetof -Werror=int-conversion -Wno-reserved-id-macro -Wno-format-pedantic -Wno-unused-command-line-argument   -integrated-as -fstack-protector-strong    -integrated-as -target x86_64-apple-darwin   -isystem /Applications/Xcode-5.0.2.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1 -Wsign-promo  -Wno-inconsistent-missing-override    -target x86_64-apple-darwin -c -std=c++11 -g -W -Wall -MMD -MP -O -DNOLOG -march=native -o out/host/darwin-x86/obj/EXECUTABLES/ckati_intermediates/func.o build/kati/func.cc
In file included from build/kati/eval.cc:17:
build/kati/eval.h:18:10: fatal error: 'unordered_map' file not found
#include <unordered_map>
         ^
build/kati/exec.cc:23:10: fatal error: 'unordered_map' file not found
#include <unordered_map>
         ^
In file included from build/kati/fileutil.cc:17:
build/kati/fileutil.h:20:10: fatal error: 'unordered_map' file not found
#include <unordered_map>
         ^
In file included from build/kati/file_cache.cc:17:
build/kati/file_cache.h:20:10: fatal error: 'unordered_set' file not found
#include <unordered_set>
         ^
In file included from build/kati/dep.cc:17:
build/kati/dep.h:19:10: fatal error: 'unordered_map' file not found
#include <unordered_map>
         ^
In file included from build/kati/find.cc:17:
build/kati/find.h:20:10: fatal error: 'unordered_set' file not found
#include <unordered_set>
         ^
1 error generated.
In file included from build/kati/expr.cc:17:
In file included from build/kati/expr.h:21:
build/kati/string_piece.h:213:19: error: explicit specialization of non-template struct 'hash'
template<> struct hash<StringPiece> {
                  ^   ~~~~~~~~~~~~~
make: *** [out/host/darwin-x86/obj/EXECUTABLES/ckati_intermediates/file_cache.o] Error 1
make: *** Waiting for unfinished jobs....
In file included from build/kati/expr.cc:21:
build/kati/eval.h:18:10: fatal error: 'unordered_map' file not found
#include <unordered_map>
         ^
In file included from build/kati/affinity.cc:17:
In file included from build/kati/flags.h:21:
build/kati/string_piece.h:213:19: error: explicit specialization of non-template struct 'hash'
template<> struct hash<StringPiece> {
                  ^   ~~~~~~~~~~~~~
In file included from build/kati/flags.cc:17:
In file included from build/kati/flags.h:21:
build/kati/string_piece.h:213:19: error: explicit specialization of non-template struct 'hash'
template<> struct hash<StringPiece> {
                  ^   ~~~~~~~~~~~~~
In file included from build/kati/affinity.cc:17:
In file included from build/kati/flags.h:22:
build/kati/symtab.h:88:19: error: explicit specialization of non-template struct 'hash'
template<> struct hash<Symbol> {
                  ^   ~~~~~~~~
In file included from build/kati/command.cc:17:
In file included from build/kati/command.h:20:
In file included from build/kati/symtab.h:21:
build/kati/string_piece.h:213:19: error: explicit specialization of non-template struct 'hash'
template<> struct hash<StringPiece> {In file included from 
build/kati/flags.cc:                  ^   ~~~~~~~~~~~~~17
:
In file included from build/kati/flags.h:22:
build/kati/symtab.h:88:19: error: explicit specialization of non-template struct 'hash'
template<> struct hash<Symbol> {
                  ^   ~~~~~~~~
build/kati/symtab.h:88:19: error: redefinition of 'hash'
build/kati/string_piece.h:213:19: note: previous definition is here
template<> struct hash<StringPiece> {
                  ^
build/kati/symtab.h:88:19: error: redefinition of 'hash'
build/kati/string_piece.h:213:19: note: previous definition is here
template<> struct hash<StringPiece> {
                  ^
In file included from build/kati/file.cc:24:
In file included from build/kati/log.h:23:
In file included from build/kati/flags.h:21:
build/kati/string_piece.h:213:19: error: explicit specialization of non-template struct 'hash'
template<> struct hash<StringPiece> {
                  ^   ~~~~~~~~~~~~~
In file included from build/kati/command.cc:17:
In file included from build/kati/command.h:20:
build/kati/symtab.h:88:19: error: explicit specialization of non-template struct 'hash'
template<> struct hash<Symbol> {
                  ^   ~~~~~~~~
build/kati/symtab.h:88:19: error: redefinition of 'hash'
build/kati/string_piece.h:213:19: note: previous definition is here
template<> struct hash<StringPiece> {
                  ^
In file included from build/kati/file.cc:24:
In file included from build/kati/log.h:23:
In file included from build/kati/flags.h:22:
build/kati/symtab.h:88:19: error: explicit specialization of non-template struct 'hash'
template<> struct hash<Symbol> {
                  ^   ~~~~~~~~
build/kati/symtab.h:88:19: error: redefinition of 'hash'
build/kati/string_piece.h:213:19: note: previous definition is here
template<> struct hash<StringPiece> {
                  ^
build/kati/command.cc:19:10: fatal error: 'unordered_map' file not found
#include <unordered_map>
         ^
3 errors generated.
1 error generated.
In file included from build/kati/func.cc:17:
In file included from build/kati/func.h:22:
In file included from build/kati/expr.h:21:
build/kati/string_piece.h:213:19: error: explicit specialization of non-template struct 'hash'
template<> struct hash<StringPiece> {
                  ^   ~~~~~~~~~~~~~
make: *** [out/host/darwin-x86/obj/EXECUTABLES/ckati_intermediates/affinity.o] Error 1
make: *** [out/host/darwin-x86/obj/EXECUTABLES/ckati_intermediates/eval.o] Error 1
In file included from build/kati/func.cc:17:
build/kati/func.h:46:3: error: unknown type name 'unique_ptr'
  unique_ptr<FindCommand> find;
  ^
build/kati/func.h:46:13: error: expected member name or ';' after declaration specifiers
  unique_ptr<FindCommand> find;
  ~~~~~~~~~~^
1 error generated.
make: *** [out/host/darwin-x86/obj/EXECUTABLES/ckati_intermediates/exec.o] Error 1
3 errors generated.
3 errors generated.
make: *** [out/host/darwin-x86/obj/EXECUTABLES/ckati_intermediates/flags.o] Error 1
make: *** [out/host/darwin-x86/obj/EXECUTABLES/ckati_intermediates/file.o] Error 1
4 errors generated.
2 errors generated.
make: *** [out/host/darwin-x86/obj/EXECUTABLES/ckati_intermediates/command.o] Error 1
make: *** [out/host/darwin-x86/obj/EXECUTABLES/ckati_intermediates/expr.o] Error 1
1 error generated.
1 error generated.
make: *** [out/host/darwin-x86/obj/EXECUTABLES/ckati_intermediates/fileutil.o] Error 1
make: *** [out/host/darwin-x86/obj/EXECUTABLES/ckati_intermediates/find.o] Error 1
build/kati/func.cc:28:10: fatal error: 'unordered_map' file not found
#include <unordered_map>
         ^
4 errors generated.
make: *** [out/host/darwin-x86/obj/EXECUTABLES/ckati_intermediates/func.o] Error 1
1 error generated.
make: *** [out/host/darwin-x86/obj/EXECUTABLES/ckati_intermediates/dep.o] Error 1

#### make failed to build some targets (1 seconds) ####

localhost:n_android guest$ 

java.io.IOException: Cannot run program "C:\Users\Jared\AppData\Local\Android\Sdk\platform-tools\adb.exe": CreateProcess error=740, The requested operation requires elevation

That error starts when I installed my Nvidia geforce 750 gtx driver. Does anybody knows how to fix this? I cant run my code on any devices i connect. Thanks

I designed my viewControllers in storyboard like from A to B,C and D by segue of Show. In A I called self.performSegue(withIdentifier: "xxxx", sender: nil) to show the target viewController.

Now my question is how to get to know in A that which viewController just disappeared? any delegate?

Thanks.