I haved saved an image to the Firebase storage and saved its URL into Firebase database,too.

But now,I have another question.How can I get the image back by the URL if my URL saved in firebase database with other text?

Is there any way to do that?

My data saved like this,

enter image description here

i have this issue. I have an application where i can login with my facebook account and i can import my profile picture form facebook. Now, for each photo, i can insert a "like". I want to transport this "like" on the facebook picture. I see the Like plugin for web, but this do all automatic. i want to give the input at this plugin when i want, so i can control this thing. It's possible do a thing like this?

hi i have strange problem in my gridview.If I check the check box number 1, the check box number 8 also gets checked when scroll down. if I check on 2nd record, then the 9th record also gets automatically checked.I don't what's going on there I am very confusing, Please check my code let me know what's problem is there.

@Override
public View getView(int position, View convertView, ViewGroup parent) {

    String appName;
    String name = null;

    //LayoutInflater inflater = (LayoutInflater)context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);


    View gridView;

    if (convertView == null) {
        //convertView.getRecycledViewPool().setMaxRecycledViews(VIEW_TYPE,0);
        gridView = new View(context);

        // get layout from mobile.xml
        gridView = mInflater.inflate(R.layout.appsgridview, null);



    } else {
        gridView = (View) convertView;
    }
    TextView textView = (TextView)gridView.findViewById(R.id.text);
    ImageView im=(ImageView)gridView.findViewById(R.id.imageView);
    CheckBox chk=(CheckBox)gridView.findViewById(R.id.checkBox); 

        PackageInfo packInfo = packList.get(position);
        ApplicationInfo packinfo=packages.get(position);
        String namep=packinfo.name;
        appName = packInfo.applicationInfo.loadLabel(context.getPackageManager()).toString();

        textView.setText(appName);
       im.setImageDrawable(packInfo.applicationInfo.loadIcon(context.getPackageManager()));
    chk.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
        @Override
        public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
            Toast.makeText(context, "checkchange", Toast.LENGTH_SHORT).show();
        }
    });



    return gridView;
}

My app defines several (dangerous) permissions in manifest file and it works great. But (rogue/bad) user can open up settings -> apps -> appname -> permissions to disable the permission and it trips up the app (any time user manually changes the permissions from settings, it invokes App.create() and app reinitializes with disabled permissions)

How can I prevent user from manually changing the permissions?

Gradle file looks as follows (I am running the app on 6.0.1, however I donot want to change the target version to 23; hence I am not able to incorporate dangerous permissions from https://developer.android.com/guide/topics/security/permissions.html#perm-groups)

android {
compileSdkVersion 21
buildToolsVersion "21.1.2"
defaultConfig {
    applicationId "com.XX.main"
    minSdkVersion 19
    targetSdkVersion 21
    versionCode 21

}

Following figure shows the permissions are enabled and also not greyed out (hence user can disable them) settings -> apps -> appname -> permissions

im trying to make a transparent toolbar inside a AppBarLayout so the navigation drawer icon and Title appear like this Toolbar i wish to make like

this is what i achieved but i would like to remove the borders around the tool bar. i tried removing the elevation and sitting the windowContentOverlay with @null but was not successful my current achieved toolbar

I have a recycler view with card view as elements.Each card view element has a different card background color.So when I scroll the card view element under the action bar, I want to change the action bar color to background color of that card view.And similarly, the action bar should change its color to the background color next card view as I scroll through the recycler view.Is this possible?

Can an app (Android,iOS,Windows) ask the user for permission, before downloading, to read and store their browsing history in a server.(Ex in:Chrome, Safari,Firefox,Opera,Dolphin, Etc.)? If so, what are the permissions? I have not worked on any code just want to see if it's possible by knowing if the permissions exist. I saw Android has READ_HISTORY_BOOKMARKS.

I have already integrated app invites functionality.Everything works fine and app invite post is also shared for selected friends. But on the receiving end there is no notification for app invites. So is it because my app is not live yet.

i have main activity and using this style

<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar"> <!-- Customize your theme here. --> <item name="colorPrimary">@color/colorPrimary</item> <item name="colorPrimaryDark">@color/colorPrimaryDark</item> <item name="colorAccent">@color/colorAccent</item> </style>

but this still showing action bar nexcus 5 on devices enter image description here

Imagine I have a class MyLibrary, that requires to be passed an Activity as a parameter to it's constructor: public MyLibrary(Activity someActivity). Is there a way to attach an observer to someActivity within the MyLibrary constructor, so that MyLibrary would know when someActivity gets destroyed?

I'm using Bumptech's Glide for async image loading and in several places in their issues it is mentioned that after passing a context, activity or fragment to it's Glide.with() function, Glide will automatically pause images that are currently loading if the passed object gets destroyed. (Example) I'm wondering how Glide figures out when to stop loading once the given context, activity or fragment is destroyed, how does it observe it?

Ideally I'd like to do something along the following lines (note this is a made up example):

public MyLibrary(Activity someActivity){
    someActivity.addLifecycleObserver(new LifecycleObserver(){
        @Override
        public void onStart() {}

        @Override
        public void onStop() {}

        @Override
        public void onDestroy() {}
    });
}

I have create simple json data pass user first name and last name but i have display only one record but i have put intent in for loop this time multiple activity create and above for loop put intent this time display only one create.
**My Json Activity **

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);
    fn = (EditText) findViewById(R.id.fn);
    ln = (EditText) findViewById(R.id.ln);
    insert = (Button) findViewById(R.id.insert1);
    show = (Button) findViewById(R.id.button2);

    requestQueue = Volley.newRequestQueue(getApplicationContext());

    show.setOnClickListener(new OnClickListener() {

        @Override
        public void onClick(View v) {
            class GetDataJSON extends AsyncTask<String, Void, String> {

                @Override
                protected String doInBackground(String... params) {

                    DefaultHttpClient httpclient = new DefaultHttpClient(
                            new BasicHttpParams());

                    HttpPost httppost = new HttpPost(
                            "http://192.168.2.5/Demo/lgin.php");

                    httppost.setHeader("Content-type", "application/json");
                    InputStream inputStream = null;
                    String result = null;
                    try {
                        HttpResponse response = httpclient
                                .execute(httppost);
                        HttpEntity entity = response.getEntity();
                        inputStream = entity.getContent();

                        BufferedReader reader = new BufferedReader(
                                new InputStreamReader(inputStream, "UTF-8"),
                                8);

                        StringBuilder sb = new StringBuilder();
                        String line = null;
                        while ((line = reader.readLine()) != null) {
                            sb.append(line + "\n");
                        }
                        result = sb.toString();

                    } catch (Exception e) {
                    } finally {
                        try {
                            if (inputStream != null)
                                inputStream.close();
                        } catch (Exception squish) {

                        }
                    }
                    return result;
                }

                @Override
                protected void onPostExecute(String result) { 
                    JSONObject jsonObj = null;
                    JSONArray jArray = null;
                    ArrayList<Model> data = new ArrayList<>();
                    try {
                        jsonObj = new JSONObject(result);
                        jArray = jsonObj.getJSONArray("userdetail");

                        Model model = new Model();

                        for (int i = 0; i < jArray.length(); i++) {

                            JSONObject jObject = null;
                            jObject = jArray.getJSONObject(i);


                            model.setName(jObject.getString("user"));
                            model.setLastname(jObject.getString("pass"));


                            Log.d(getClass().getName(), "User = " + model.getName() + "Pas = " + model.getLastname());

                            data.add(model);

                        }
                        Intent intent = new Intent(getApplicationContext(), ViewData.class);
                        Bundle bundle = new Bundle();
                        bundle.putSerializable("value", data);
                        intent.putExtras(bundle);
                        startActivity(intent);

                    } catch (JSONException e) {
                        // TODO Auto-generated catch block
                        e.printStackTrace();
                    }

                }
            }
            GetDataJSON g = new GetDataJSON();
            g.execute();

        }
    });


    insert.setOnClickListener(new OnClickListener() {

        @Override
        public void onClick(View v) {

            // TODO Auto-generated method stub
            StringRequest request = new StringRequest(Request.Method.POST, insertURl, new Response.Listener<String>() {

                @Override
                public void onResponse(String arg0) {
                    // TODO Auto-generated method stub

                }

            }, new Response.ErrorListener() {

                @Override
                public void onErrorResponse(VolleyError error) {
                    // TODO Auto-generated method stub

                }
            }) {
                @Override
                protected Map<String, String> getParams()
                        throws AuthFailureError {
                    // TODO Auto-generated method stub
                    Map<String, String> parameters = new HashMap<String, String>();
                    parameters.put("user", fn.getText().toString());
                    parameters.put("pass", ln.getText().toString());
                    Log.d(getClass().getName(), "View =" + fn.getText().toString() + "LastNAme = " + ln.getText().toString());
                    return parameters;

                }
            };
            requestQueue.add(request);
        }
    });

}

My Recyclerview Class

public class ViewData extends Activity {
private AdapterFish mAdapter;
private List<Model> View;

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

    View = (List<Model>) getIntent().getSerializableExtra("value");
    mAdapter = new AdapterFish(ViewData.this, (ArrayList<Model>) View);
    RecyclerView mRVFishPrice = (RecyclerView) findViewById(R.id.fishPriceList);
    RecyclerView.LayoutManager mLayoutManager = new LinearLayoutManager(getApplicationContext());
    mRVFishPrice.setLayoutManager(mLayoutManager);
    mRVFishPrice.setAdapter(mAdapter);
}

How can you calculate the number of weeks between two dates in android? I have done something like this

int week1 = calendar1.get(Calendar.WEEK_OF_YEAR); int week2 = calendar2.get(Calendar.WEEK_OF_YEAR); int calendarWeekDifference = (week2 - week1);

However this does not work when the two dates are in different years. How can I achieve a solution so that it will work across different years?

This is a picture of navigation drawer.

This is the picture of main activity

I have a navigation drawer, and in main activity I have 3 tabs. I want to switch between tabs from navigation drawer click. Like I am now in Services tab. But when I have clicked Home in navigation drawer activity I want to see the Home tab.

Please Help.

i convert swift 2.3 to swift 3 in xcode 8.2

swift 2.3

    if NSFileManager().fileExistsAtPath(destinationUrl!.path!) {
        if let soundData = NSData(contentsOfFile: destinationUrl!.path!) {
            self.initAudioWithData(soundData)
        }
        else {
            self.audioErrorAction()
        }
        return
    }

    if let soundData = NSData(contentsOfURL:NSURL(string:fullPath)!) {
        self.initAudioWithData(soundData)
    }
    else {
        self.audioErrorAction()
    }

swift 3: Is there an error in the code?

  if FileManager().fileExists(atPath: destinationUrl.path){
        if let soundData = try? Data(contentsOf: URL(fileURLWithPath: destinationUrl.path))

        {
            self.initAudioWithData(soundData)
        }
        else {
            self.audioErrorAction()
        }
        return
    }

    if let soundData = try? Data(contentsOf: URL(string:fullPath)!)
    {
        self.initAudioWithData(soundData)
    }
    else {
        self.audioErrorAction()
    }

after convert my error: found nil while unwrapping an Optional value

I'm working on an application that has a real-time chat component, and my current framework choice is falling apart at just hundreds of concurrent users.

Currently using MeteorJS, but it maintains a copy of all client data in server memory, which causes issues with scaling up, it's quite costly to scale.

Now I'm looking at a different framework choice, one being Django with Channels, other being plain NodeJS with Express or Socket.io. Meteor tails the Mongo Oplog to achieve realtime, so it's implemented at the database layer, while Channels would implement it at the framework level. The application I'm working on is huge, and it also is going to have mobile clients, so I'm looking for some advice on the framework and architecture choice here.

Please take a look at this AI system architecture proposal:

Double neural network architecture proposal

As you can see this is a multi-agent AI system for starcraft brood war that utilizes BWAPI AI framework, and I proposed this idea for the bot infrastructure architecture which consists of two primary neural networks where each one of these placed at specific task of management.

So here is the question for you guys: does that type of an architecture makes any sense? Is it helpful to split decision making on two specific fields?

If yes, how can I create the feedback loop for these two neural networks, in order to them to work effectively together.

I got three activities, MainActivity, OtherActivity, ThirdActivity

MainActivity as Main Menu that will direct to OtherActivity by button:

public void onClick(View v) {
        Intent myIntent = new Intent(MainActivity.this, OtherActivity.class);
        MainActivity.this.startActivity(myIntent);
    }

then inside OtherActivity contains list of data form that need to be entered into next activity which is ThirdActivity

public class OtherActivity extends Activity {

EditText Name, Age, MPersonal, MBTI, Birthday, SNotes;
Button secondbutton, thirdbutton;

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.other_activity);
    Intent myIntent = getIntent();
    secondbutton = (Button)findViewById(R.id.secondbutton);
    thirdbutton = (Button)findViewById(R.id.button3);
    Name = (EditText) findViewById(R.id.editText);
    Age = (EditText) findViewById(R.id.editText2);
    MPersonal = (EditText) findViewById(R.id.editText3);
    MBTI = (EditText) findViewById(R.id.editText4);
    Birthday = (EditText) findViewById(R.id.editText5);
    SNotes = (EditText) findViewById(R.id.editText6);

}
public void onClick2(View view) {
    Intent backIntent = new Intent(OtherActivity.this, MainActivity.class);
    OtherActivity.this.startActivity(backIntent);
}
public void onClick3(View view) {
    Intent bintent = new Intent(this, ThirdActivity.class);
    Bundle bbundle = new Bundle();
    bbundle.putString("name", Name.getText().toString());
    bbundle.putString("age", Age.getText().toString());
    bbundle.putString("mper", MPersonal.getText().toString());
    bbundle.putString("mbti", MBTI.getText().toString());
    bbundle.putString("birthday", Birthday.getText().toString());
    bbundle.putString("special", SNotes.getText().toString());
    bintent.putExtras(bbundle);
    startActivity(bintent);

}
}

and it worked well it directly send intent to ThirdActivity which is:

public class ThirdActivity extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.data_activity);
    TextView nameView = (TextView) findViewById(R.id.nametext);
    nameView.setText(getIntent().getExtras().getString("name"));
    TextView ageView = (TextView) findViewById(R.id.agetext);
    ageView.setText(getIntent().getExtras().getString("age"));
    TextView mperView = (TextView) findViewById(R.id.mpersonalitytext);
    mperView.setText(getIntent().getExtras().getString("mper"));
    TextView mbtiView = (TextView) findViewById(R.id.mbtitext);
    mbtiView.setText(getIntent().getExtras().getString("mbti"));
    TextView birthdayView = (TextView) findViewById(R.id.birthdaytext);
    birthdayView.setText(getIntent().getExtras().getString("birthday"));
    TextView specialView = (TextView) findViewById(R.id.specialtext);
    specialView.setText(getIntent().getExtras().getString("special"));
}

Inside ThirdActivity also contains onClick Function and redirect to main menu:

    public void Clicky (View vclicky) {
    Intent intentclick = new Intent(ThirdActivity.this, MainActivity.class);
    ThirdActivity.this.startActivity(intentclick);
}

It worked well. But when i try to return to ThirdActivity which list inputted Data. Error Occurred when i try to click Button:

public void onClicky(View vclick) {
    Intent kuriki = new Intent(MainActivity.this, ThirdActivity.class);
    MainActivity.this.startActivity(kuriki);
}

The error message say:

E/AndroidRuntime: FATAL EXCEPTION: main Process: com.example.user.myapplication, PID: 3739 java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.user.myapplication/com.example.user.myapplication.ThirdActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String android.os.BaseBundle.getString(java.lang.String)' on a null object reference at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2646) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2707) at android.app.ActivityThread.-wrap12(ActivityThread.java)

Could you please help me why i am unable to return to Inputted Data. Also i seems don't understand the error message. Thanks in advance

i have read lot about WakefulBroadcastReceiver...but didn't get anywhere about how to even call this from main activity...whenever i search how to call WakefulBroadcastReceiver..the result always shows me how to call IntentService from WakefulBroadcastReceiver...

Well to call IntentService we write the code "startService()" in activity or in WakefulBroadcastReceiver... to call BroadcastReceiver we write

AlarmManager am.set(AlarmManager.RTC_WAKEUP, calendar.getTimeInMillis(),
      PendingIntent.getBroadcast(this, 0, intent,PendingIntent.FLAG_UPDATE_CURRENT));

But i don't find anywhere how to call "WakefulBroadcastReceiver"... plse help..

I tried the hydra against my own icloud email but I couldn't and it showed me this error message:

hydra could not create ssl session

I scripted this:

hydra -l example@icloud.com -P password.lst -s 587 -S -v -V -t 1 smtp.mail.me.com smtp

As you can I used the port 587 and the server of smtp.mail.me.com

So any idea about this issue and how can I solve it ...thanks !

I am having a situation in which I have to hide the button on the right side of nav bar. Button name is btnRefresh, and I can hide it successfully by this way

self.nvbar.topItem?.rightBarButtonItem = nil

but when I use this for showing it again, it didn't get displayed again

self.nvbar.topItem?.rightBarButtonItem = btnRefresh

Any help???

So I've recently implemented a variation of the dirty_c0w exploit on a Nexus 6P running Nougat 7.0 (NBD90X to be specific) using the radare2 method. I'm not sure I totally grasp the concept of r2 though and I was wondering if anybody here knew much about the topic? Maybe my question is a little vague and I apologize if this is the case, this is the first time I've ever asked anything here so bear with me.