ios pod install

I’m pretty sure you are not in the right directory. Are you sure your .xcodeproj is in the Developer folder? There might be a subfolder you need to navigate to.

The right way to enable CocoaPods in your Project is:

  1. Open Terminal and execute: $ sudo gem install cocoapods
  2. Navigate to your Project folder (I assume in your case it’s cd /Users/myName/Developer/SimpleWeather/SimpleWeather.xcodeproj).
  3. Setup Cocoapod pod setup
  4. Create the Podfile touch Podfile
  5. Open the Podfile open -e Podfile and insert your code for Podfile
  6. Finally install the Podfile pod install

If you follow this instructions everything should work. When opening your project make sure to open the .xworkspacefile.

For more information: http://cocoapods.org/

Advertisements

Android different screen size image for hdpi , mdpi , ldpi

320dp: a typical phone screen (240×320 ldpi, 320×480 mdpi, 480×800 hdpi, etc).
480dp: a tweener tablet like the Streak (480×800 mdpi).
600dp: a 7” tablet (600×1024 mdpi).
720dp: a 10” tablet (720×1280 mdpi, 800×1280 mdpi, etc).

details : http://stackoverflow.com/questions/6166677/android-screen-size-hdpi-ldpi-mdpi

Android Recycler view Horizontal and vertical Orientation Scroll Controll

mLayoutManager = new LinearLayoutManager(convertView.getContext(),LinearLayoutManager.HORIZONTAL,false);

Complete Example :


import android.app.Fragment;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import com.dsb.deshipos.Adapter.CatergoryAdapter;
import com.dsb.deshipos.Library.HandlingServer;
import com.dsb.deshipos.Model.Category;
import com.dsb.deshipos.R;

import java.util.ArrayList;

/**
* Created by dynamicsolversbangladesh1 on 3/31/16.
*/
public class ItemListFragment extends Fragment {
private RecyclerView mRecyclerView;
private RecyclerView.Adapter mAdapter;
private RecyclerView.LayoutManager mLayoutManager;

ArrayList categoryArrayList;

HandlingServer handlingServer;

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

mRecyclerView = (RecyclerView) convertView.findViewById(R.id.item_recycler);

// use this setting to improve performance if you know that changes
// in content do not change the layout size of the RecyclerView
mRecyclerView.setHasFixedSize(true);

// use a linear layout manager
mLayoutManager = new LinearLayoutManager(convertView.getContext(),LinearLayoutManager.HORIZONTAL,false);
mRecyclerView.setLayoutManager(mLayoutManager);

handlingServer=new HandlingServer(convertView.getContext());
categoryArrayList=handlingServer.getAllCategories();

// specify an adapter (see also next example)
mAdapter = new CatergoryAdapter(convertView.getContext(),categoryArrayList);
mRecyclerView.setAdapter(mAdapter);
return convertView;
}
}

How to add Parent appbar to child layout in Android Material design

We have to just add

app:layout_behavior="@string/appbar_scrolling_view_behavior"

at the child layout parent layout like Relative or Linear Layout.

example:


<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android&quot;
xmlns:app="http://schemas.android.com/apk/res-auto&quot;
xmlns:tools="http://schemas.android.com/tools&quot;
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
app:layout_behavior="@string/appbar_scrolling_view_behavior"
tools:context="com.resturant.vivaatech.resturantapp.Activities.ReportActivity"
tools:showIn="@layout/activity_report">

android edittext focus

Focus movement is based on an algorithm which finds the nearest neighbor in a given direction. In rare cases, the default algorithm may not match the intended behavior of the developer.

Change default behaviour of directional navigation by using following XML attributes:

android:nextFocusDown="@+id/.."
android:nextFocusLeft="@+id/.."
android:nextFocusRight="@+id/.."
android:nextFocusUp="@+id/.."

Besides directional navigation you can use tab navigation. For this you need to use

android:nextFocusForward="@+id/.."

To get a particular view to take focus, call

view.requestFocus()

How to add EditText keboard done button

android:imeOptions="actionDone"
android:singleLine="true"

add this two line on EditText

example:

<EditText
android:imeOptions="actionDone"
android:singleLine="true"
android:hint="PASSWORD"
android:paddingLeft="20dp"
android:layout_marginTop="20dp"
android:background="@drawable/round_edittext_corner"
android:layout_width="wrap_content"
android:layout_height="50dp"
android:id="@+id/editText_password_from_loginByEmailAddress"
android:layout_below="@+id/editText_email_from_loginByEmailAddress"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_alignRight="@+id/editText_email_from_loginByEmailAddress"
android:layout_alignEnd="@+id/editText_email_from_loginByEmailAddress" />

How to add show navigation drawer with button click

  1. Take Button and implement click event
  2. Take navigation drawer and make it findViewById
  3. openDrawer(Gravity.Right) into button Click event .

 

DrawerLayout mDrawerLayout;
Button mButton;

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);
    final Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
    setSupportActionBar(toolbar);
    mDrawerLayout = (DrawerLayout) findViewById(R.id.drawer_layout);
    mButton= (Button) findViewById(R.id.button);
mButton.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            mDrawerLayout.openDrawer(Gravity.END);

        }
    });


}

4 . if we want to make navigation back




add this to oncreate method

DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout);
ActionBarDrawerToggle toggle = new ActionBarDrawerToggle(
        this, drawer, toolbar, R.string.navigation_drawer_open, R.string.navigation_drawer_close);
drawer.setDrawerListener(toggle);
toggle.syncState();

NavigationView navigationView = (NavigationView) findViewById(R.id.nav_view);
navigationView.setNavigationItemSelectedListener(this);
@Override
public void onBackPressed() {
    DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout);
    if (drawer.isDrawerOpen(Gravity.RIGHT)) {
        drawer.closeDrawer(Gravity.RIGHT);
    } else {
        super.onBackPressed();
    }
}

Fibonacci with python(using recursion )

# Python program to display the Fibonacci sequence up to n-th term using recursive functions

def recur_fibo(n):
“””Recursive function to
print Fibonacci sequence”””
if n <= 1:
return n
else:
return(recur_fibo(n-1) + recur_fibo(n-2))

# take input from the user
nterms = int(input(“How many terms? “))

# check if the number of terms is valid
if nterms <= 0:
print(“Plese enter a positive integer”)
else:
print(“Fibonacci sequence:”)
for i in range(nterms):
print(recur_fibo(i))