[APP] - version 3.24.+ ( 31. 5. 2017 )

Started by Menion, May 31, 2017, 14:48:21

0 Members and 3 Guests are viewing this topic.

Menion

Hello,
hmm damn. Yes there was a change. Google since Android 7 disabled inexact broadcast intents, so now every intent has to be directly send to certain application.

How is your broadcast receiver registered? It's directly in manifest of your app or you use ActionTools.enablePeriodicUpdatesReceiver method over Locus API?
- Official help (ideas, questions, problems): help.locusmap.eu
- Advanced topics, sharing of knowledges: you're here!
- LM 4 Beta download, LM 4 Release download
  •  

zigzag

Hello,

I use manifest to start the app with Locus, and it works, because the app start.

        <receiver
            android:name=".PeriodicUpdateReceiver"
            android:enabled="true"
            android:exported="true">
            <intent-filter>
                <action android:name="locus.api.android.ACTION_PERIODIC_UPDATE" />
            </intent-filter>
        </receiver>


I use a new receiver in running app, while it running. It not receive data.

        receiver = new BroadcastReceiver() {

            @Override
            public void onReceive(Context context, Intent intent) {
                Log.d("Most jött", "adat a locustól");
                try {
                    // Értelmes adat érkezett-e be?
                    if (intent == null || intent.getAction() == null) {
                        return;
                    }


                    if (!isLocusRunning(context)) {
                        return;
                    }

                    // Beolvassa a kapott adatokat
                    PeriodicUpdatesHandler.getInstance().onReceive(appContext, intent, updateHandler);
                } catch (Exception e) {
                    return;
                }
            }
        };

        IntentFilter filter = new IntentFilter(
                LocusConst.ACTION_PERIODIC_UPDATE);
        registerReceiver(receiver, filter);

    private PeriodicUpdatesHandler.OnUpdate updateHandler = new PeriodicUpdatesHandler.OnUpdate() {
        /*
         * Locustól kapott adatok beolvasásának a függvénye
         */

        @Override
        public void onUpdate(LocusUtils.LocusVersion locusVersion, UpdateContainer update) {
            lastUpdate = update;
            updatee(false);
            Log.d("Most jött", "adat a locustól");
        }

        @Override
        public void onIncorrectData() {
        }
    };
  •  

Menion

#47
Hello,
ah here probably comes a problem.
It is not possible to correctly register receiver for updates without letting know Locus Map that something like happen.

For cases, you wants to register receiver dynamically, it is necessary to ActionTools.refreshPeriodicUpdateListeners method . It is private now, so I'll make it public to next API version.

Second method I recommend is to use registered, but disabled, receiver in manifest


        <receiver
            android:name=".PeriodicUpdatesReceiver"
            android:enabled="false">

            <intent-filter>
                <action
                    android:name="locus.api.android.ACTION_PERIODIC_UPDATE" />
            </intent-filter>
        </receiver>


And enable/disable it with ActionTools.enablePeriodicUpdatesReceiver or similar ActionTools.disablePeriodicUpdatesReceiver.

I'll also try to add some "automatic refresh" into Locus Map to next version. Let me anyway know if this helped.

EDIT: back, I knew that "private" for refresh has some reason.

https://stackoverflow.com/questions/3862207/querybroadcastreceivers-does-not-find-receivers-registered-with-registerreceiver

So only possible method how to make this all work, is to have receiver registered in manifest!! And enable/disable it on runtime as I mentioned in second method. I'm sure if this will be fixed in your app, it will work correctly. I have to fix this stupid issue in manual as well , sorry my bad.
- Official help (ideas, questions, problems): help.locusmap.eu
- Advanced topics, sharing of knowledges: you're here!
- LM 4 Beta download, LM 4 Release download
  •  

zigzag

Thanks for your answer, i fixed the issue.
  •  

Menion

Thanks, glad it works. And sorry for a complications. This all was changed because of this "stupid" change in Android 8.0 : https://developer.android.com/preview/features/background-broadcasts.html .
So only solution is not to send general public intent with Periodic updates, but every send intent send directly to application that wants it. And your receiver registered manually at runtime was unfortunately undetectable by Locus Map as I mentioned in the end of my previous post. Thanks for understanding.
- Official help (ideas, questions, problems): help.locusmap.eu
- Advanced topics, sharing of knowledges: you're here!
- LM 4 Beta download, LM 4 Release download
  •  

Henk van der Spek

Quote from: menion on June 14, 2017, 11:50:02
....
@joeloc , @hank : you will see in next version, performance improved

Ok, I had a good field test today with (not beta) version 3.24.2 and I can confirm a significant performance improvement. With track style like arrows, zoomlevel 21 and switching to guidance for a geocache I had no more problems of freezing screen etc.
Oh and zoomlevel 22 killed the arrows track style and switched it automatically to a straight line, which is fine for me. Zooming out reverses that; great extra. Thank you Menion and team.
Motorola G82 5G 6/128 Android 13 and Motorola Moto G73 5G 8/256 Android 13
  •  

lor74cas

I can not comment the performances of Locus about style but I noticed a quicker start up with the last version

Inviato dal mio SM-G800F utilizzando Tapatalk

Locus Map 4
Locus Map for Garmin
Locus Tasker
  •  

Andrew Heard

I'm being slack. I should add a new help topic as this is not a beta bug, but am on the road, and this is quicker, and a simple bug. In the offline address search, if you paste in an address then edit the string such as backspace, mid string, NOT at the end, the cursor position is lost, and returns to the end of string after each tap. Very easy to reproduce and annoying.
LM4.26.0 GOLD user ID:c7d47597a
  •  

Menion

hi guys, I'm glad you noticed some speed improvements ... they are there :).

@Andrew Heard: thanks, fixed!
- Official help (ideas, questions, problems): help.locusmap.eu
- Advanced topics, sharing of knowledges: you're here!
- LM 4 Beta download, LM 4 Release download
  •  

Henk van der Spek

In 3.24.2 the weather is going funny when I on the couch at home in the Netherlands select Paikuse Estonia. Today is wednesday 19.00 hrs 280617 and the screen shows also yesterday. I know there is a one hour time difference, is that the cause?

Motorola G82 5G 6/128 Android 13 and Motorola Moto G73 5G 8/256 Android 13
  •  

Menion

Hello Henk, thanks for a bug report. More complicated then I've expected :). Will be solved in next version.
- Official help (ideas, questions, problems): help.locusmap.eu
- Advanced topics, sharing of knowledges: you're here!
- LM 4 Beta download, LM 4 Release download
  •  

john_percy

Since the last two (?) releases, the map does not redraw properly on switching themes and requires zoom in and out to redraw correctly.

Sent from my XT1039 using Tapatalk

Voluntary and Velocity themes - https://voluntary.nichesite.org
  •  

Menion

Good day John,
what exactly is "not properly"? Do you see after change of theme black areas or some "loading..." empty map and simple zoom in/out fix it? if yes, then Petr discovered this problem a day or two before and should be fixed in next version. If this is something different, screenshot should be useful here. Thanks!
- Official help (ideas, questions, problems): help.locusmap.eu
- Advanced topics, sharing of knowledges: you're here!
- LM 4 Beta download, LM 4 Release download
  •  

jusc

If you work on a theme it´s necessary to reload it very often. But after a few times, it seems that Locus load the "cached" theme settings before. So I have to close Locus, than I have to do anything else with the phone to "clear memory" and to restart Locus.
I see this since one year(?) and not only since the last two releases, 
Regards J.
  •  

john_percy

Some black areas, some wireframe drawing (lines very thin, no fills). Simple zoom in/out fixes it.

Quote from: menion on July 01, 2017, 11:06:25what exactly is "not properly"? Do you see after change of theme black areas or some "loading..." empty map and simple zoom in/out fix it? if yes, then Petr discovered this problem a day or two before and should be fixed in next version. If this is something different, screenshot should be useful here. Thanks!
Voluntary and Velocity themes - https://voluntary.nichesite.org
  •