Wednesday, 31 August 2022

Django Google News Sitemap

Does anyone know how to implement the google news sitemap standard on Django? https://developers.google.com/search/docs/advanced/sitemaps/news-sitemap

I am struggling to find any mention of how its implemented with Django.

Example of how it should look.

<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"
        xmlns:news="http://www.google.com/schemas/sitemap-news/0.9">
  <url>
   <loc>http://www.example.org/business/article55.html</loc>
   <news:news>
   <news:publication>
     <news:name>The Example Times</news:name>
     <news:language>en</news:language>
   </news:publication>
   <news:publication_date>2008-12-23</news:publication_date>
     <news:title>Companies A, B in Merger Talks</news:title>
    </news:news>
  </url>
</urlset>

What I currently have looks very simple.

<url>
<loc>https://mynewsite.net/news/this-news-article/</loc>
<lastmod>2022-04-04</lastmod>
</url>
<url>


from Django Google News Sitemap

Changing the Orientation Smoothly for SDK from App

I know the question related to orientation has been asked multiple times, but I am facing some weird issue. I am working on one SDK that has some Activity which can be opened from the App, The SDK asks for the orientation values from the App and I am updating the orientation in onCreate() of the Activity by setting:

requestedOrientation = orientation

It works perfectly when I am holding the device in the same orientation as the orientation is set by App. But If I am holding the device in portrait mode and setting the requestedOrientation to LANDSCAPE then my screen flickers, 1st it shows the portrait screen and then goes to landscape. In manifest I have set the configChanges to android:configChanges="keyboard|keyboardHidden|screenSize" I have separate layouts for both the orientations. Let me know, if anything else is also required.



from Changing the Orientation Smoothly for SDK from App

Android app uses API 31 java 8 instead of installed java 11

I have generated a react native app and want to use the installed java 11 at source code run time instead of java 8.

In android studio when hovering over react-native-gradle-plugin, it uses java 11 which I installed which java -version in terminal is java 11:

enter image description here

Source code used to run the app still use API 31 java 8:

enter image description here enter image description here

Is it possible to pack java 11 into android.jar then replace the java 8 in API 31 folder

app/build.gradle:

enter image description here

SDK:

enter image description here

App structure:

enter image description here

Build tools:

enter image description here



from Android app uses API 31 java 8 instead of installed java 11